00001 /***************************************************************************** 00002 00003 Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it under 00006 the terms of the GNU General Public License as published by the Free Software 00007 Foundation; version 2 of the License. 00008 00009 This program is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License along with 00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 00015 St, Fifth Floor, Boston, MA 02110-1301 USA 00016 00017 *****************************************************************************/ 00018 00019 /**************************************************/ 00026 #pragma once 00027 #ifndef dict0crea_h 00028 #define dict0crea_h 00029 00030 #include "univ.i" 00031 #include "dict0types.h" 00032 #include "dict0dict.h" 00033 #include "que0types.h" 00034 #include "row0types.h" 00035 #include "mtr0mtr.h" 00036 00037 /*********************************************************************/ 00040 UNIV_INTERN 00041 tab_node_t* 00042 tab_create_graph_create( 00043 /*====================*/ 00044 dict_table_t* table, 00046 mem_heap_t* heap); 00047 /*********************************************************************/ 00050 UNIV_INTERN 00051 ind_node_t* 00052 ind_create_graph_create( 00053 /*====================*/ 00054 dict_index_t* index, 00056 mem_heap_t* heap); 00057 /***********************************************************/ 00060 UNIV_INTERN 00061 que_thr_t* 00062 dict_create_table_step( 00063 /*===================*/ 00064 que_thr_t* thr); 00065 /***********************************************************/ 00069 UNIV_INTERN 00070 que_thr_t* 00071 dict_create_index_step( 00072 /*===================*/ 00073 que_thr_t* thr); 00074 /*******************************************************************/ 00077 UNIV_INTERN 00078 ulint 00079 dict_truncate_index_tree( 00080 /*=====================*/ 00081 dict_table_t* table, 00082 ulint space, 00085 btr_pcur_t* pcur, 00089 mtr_t* mtr); 00092 /*******************************************************************/ 00094 UNIV_INTERN 00095 void 00096 dict_drop_index_tree( 00097 /*=================*/ 00098 rec_t* rec, 00100 mtr_t* mtr); 00101 /****************************************************************/ 00106 UNIV_INTERN 00107 ulint 00108 dict_create_or_check_foreign_constraint_tables(void); 00109 /*================================================*/ 00110 /********************************************************************/ 00118 UNIV_INTERN 00119 ulint 00120 dict_create_add_foreigns_to_dictionary( 00121 /*===================================*/ 00122 ulint start_id, 00130 dict_table_t* table, 00131 trx_t* trx); 00133 /* Table create node structure */ 00134 00135 struct tab_node_struct{ 00136 que_common_t common; 00137 dict_table_t* table; 00139 ins_node_t* tab_def; /* child node which does the insert of 00140 the table definition; the row to be inserted 00141 is built by the parent node */ 00142 ins_node_t* col_def; /* child node which does the inserts of 00143 the column definitions; the row to be inserted 00144 is built by the parent node */ 00145 commit_node_t* commit_node; 00146 /* child node which performs a commit after 00147 a successful table creation */ 00148 /*----------------------*/ 00149 /* Local storage for this graph node */ 00150 ulint state; 00151 ulint col_no; 00152 mem_heap_t* heap; 00153 }; 00154 00155 /* Table create node states */ 00156 #define TABLE_BUILD_TABLE_DEF 1 00157 #define TABLE_BUILD_COL_DEF 2 00158 #define TABLE_COMMIT_WORK 3 00159 #define TABLE_ADD_TO_CACHE 4 00160 #define TABLE_COMPLETED 5 00161 00162 /* Index create node struct */ 00163 00164 struct ind_node_struct{ 00165 que_common_t common; 00166 dict_index_t* index; 00168 ins_node_t* ind_def; /* child node which does the insert of 00169 the index definition; the row to be inserted 00170 is built by the parent node */ 00171 ins_node_t* field_def; /* child node which does the inserts of 00172 the field definitions; the row to be inserted 00173 is built by the parent node */ 00174 commit_node_t* commit_node; 00175 /* child node which performs a commit after 00176 a successful index creation */ 00177 /*----------------------*/ 00178 /* Local storage for this graph node */ 00179 ulint state; 00180 ulint page_no;/* root page number of the index */ 00181 dict_table_t* table; 00182 dtuple_t* ind_row;/* index definition row built */ 00183 ulint field_no;/* next field definition to insert */ 00184 mem_heap_t* heap; 00185 }; 00186 00187 /* Index create node states */ 00188 #define INDEX_BUILD_INDEX_DEF 1 00189 #define INDEX_BUILD_FIELD_DEF 2 00190 #define INDEX_CREATE_INDEX_TREE 3 00191 #define INDEX_COMMIT_WORK 4 00192 #define INDEX_ADD_TO_CACHE 5 00193 00194 #ifndef UNIV_NONINL 00195 #include "dict0crea.ic" 00196 #endif 00197 00198 #endif