dict0crea.h
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:4k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /******************************************************
  2. Database object creation
  3. (c) 1996 Innobase Oy
  4. Created 1/8/1996 Heikki Tuuri
  5. *******************************************************/
  6. #ifndef dict0crea_h
  7. #define dict0crea_h
  8. #include "univ.i"
  9. #include "dict0types.h"
  10. #include "dict0dict.h"
  11. #include "que0types.h"
  12. #include "row0types.h"
  13. #include "mtr0mtr.h"
  14. /*************************************************************************
  15. Creates the default clustered index for a table: the records are ordered
  16. by row id. */
  17. void
  18. dict_create_default_index(
  19. /*======================*/
  20. dict_table_t* table, /* in: table */
  21. trx_t* trx); /* in: transaction handle */
  22. /*************************************************************************
  23. Creates a table create graph. */
  24. tab_node_t*
  25. tab_create_graph_create(
  26. /*====================*/
  27. /* out, own: table create node */
  28. dict_table_t* table, /* in: table to create, built as a memory data
  29. structure */
  30. mem_heap_t* heap); /* in: heap where created */
  31. /*************************************************************************
  32. Creates an index create graph. */
  33. ind_node_t*
  34. ind_create_graph_create(
  35. /*====================*/
  36. /* out, own: index create node */
  37. dict_index_t* index, /* in: index to create, built as a memory data
  38. structure */
  39. mem_heap_t* heap); /* in: heap where created */
  40. /***************************************************************
  41. Creates a table. This is a high-level function used in SQL execution graphs. */
  42. que_thr_t*
  43. dict_create_table_step(
  44. /*===================*/
  45. /* out: query thread to run next or NULL */
  46. que_thr_t* thr); /* in: query thread */
  47. /***************************************************************
  48. Creates an index. This is a high-level function used in SQL execution
  49. graphs. */
  50. que_thr_t*
  51. dict_create_index_step(
  52. /*===================*/
  53. /* out: query thread to run next or NULL */
  54. que_thr_t* thr); /* in: query thread */
  55. /***********************************************************************
  56. Drops the index tree associated with a row in SYS_INDEXES table. */
  57. void
  58. dict_drop_index_tree(
  59. /*=================*/
  60. rec_t* rec, /* in: record in the clustered index of SYS_INDEXES
  61. table */
  62. mtr_t* mtr); /* in: mtr having the latch on the record page */
  63. /* Table create node structure */
  64. struct tab_node_struct{
  65. que_common_t common; /* node type: QUE_NODE_TABLE_CREATE */
  66. dict_table_t* table; /* table to create, built as a memory data
  67. structure with dict_mem_... functions */
  68. ins_node_t* tab_def; /* child node which does the insert of
  69. the table definition; the row to be inserted
  70. is built by the parent node  */
  71. ins_node_t* col_def; /* child node which does the inserts of
  72. the column definitions; the row to be inserted
  73. is built by the parent node  */
  74. commit_node_t* commit_node;
  75. /* child node which performs a commit after
  76. a successful table creation */
  77. /*----------------------*/
  78. /* Local storage for this graph node */
  79. ulint state; /* node execution state */
  80. ulint col_no; /* next column definition to insert */
  81. mem_heap_t* heap; /* memory heap used as auxiliary storage */
  82. };
  83. /* Table create node states */
  84. #define TABLE_BUILD_TABLE_DEF 1
  85. #define TABLE_BUILD_COL_DEF 2
  86. #define TABLE_COMMIT_WORK 3
  87. #define TABLE_ADD_TO_CACHE 4
  88. #define TABLE_COMPLETED 5
  89. /* Index create node struct */
  90. struct ind_node_struct{
  91. que_common_t common; /* node type: QUE_NODE_INDEX_CREATE */
  92. dict_index_t* index; /* index to create, built as a memory data
  93. structure with dict_mem_... functions */
  94. ins_node_t* ind_def; /* child node which does the insert of
  95. the index definition; the row to be inserted
  96. is built by the parent node  */
  97. ins_node_t* field_def; /* child node which does the inserts of
  98. the field definitions; the row to be inserted
  99. is built by the parent node  */
  100. commit_node_t* commit_node;
  101. /* child node which performs a commit after
  102. a successful index creation */
  103. /*----------------------*/
  104. /* Local storage for this graph node */
  105. ulint state; /* node execution state */
  106. dict_table_t* table; /* table which owns the index */
  107. dtuple_t* ind_row;/* index definition row built */
  108. ulint field_no;/* next field definition to insert */
  109. mem_heap_t* heap; /* memory heap used as auxiliary storage */
  110. };
  111. /* Index create node states */
  112. #define INDEX_BUILD_INDEX_DEF 1
  113. #define INDEX_BUILD_FIELD_DEF 2
  114. #define INDEX_CREATE_INDEX_TREE 3
  115. #define INDEX_COMMIT_WORK 4
  116. #define INDEX_ADD_TO_CACHE 5
  117. #ifndef UNIV_NONINL
  118. #include "dict0crea.ic"
  119. #endif
  120. #endif