InnoDB Plugin  1.0
dict0crea.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #ifndef dict0crea_h
27 #define dict0crea_h
28 
29 #include "univ.i"
30 #include "dict0types.h"
31 #include "dict0dict.h"
32 #include "que0types.h"
33 #include "row0types.h"
34 #include "mtr0mtr.h"
35 
36 /*********************************************************************/
39 UNIV_INTERN
42 /*====================*/
43  dict_table_t* table,
45  mem_heap_t* heap,
46  bool commit);
48 /*********************************************************************/
51 UNIV_INTERN
54 /*====================*/
55  dict_index_t* index,
57  mem_heap_t* heap,
58  bool commit);
60 /***********************************************************/
63 UNIV_INTERN
64 que_thr_t*
66 /*===================*/
67  que_thr_t* thr);
68 /***********************************************************/
72 UNIV_INTERN
73 que_thr_t*
75 /*===================*/
76  que_thr_t* thr);
77 /*******************************************************************/
80 UNIV_INTERN
81 ulint
83 /*=====================*/
84  dict_table_t* table,
85  ulint space,
88  btr_pcur_t* pcur,
92  mtr_t* mtr);
95 /*******************************************************************/
97 UNIV_INTERN
98 void
100 /*=================*/
101  rec_t* rec,
103  mtr_t* mtr);
104 /****************************************************************/
109 UNIV_INTERN
110 dberr_t
112 /*================================================*/
113 /********************************************************************/
118 UNIV_INLINE
119 dberr_t
121 /*=======================*/
122  ulint* id_nr,
124  const char* name,
125  dict_foreign_t* foreign)
126  __attribute__((nonnull));
127 
138 UNIV_INTERN
139 dberr_t
141 /*===================================*/
142  const dict_foreign_set& local_fk_set,
143  const dict_table_t* table,
144  trx_t* trx)
145  __attribute__((nonnull, warn_unused_result));
146 /****************************************************************/
151 UNIV_INTERN
152 dberr_t
154 /*=====================================*/
155 /********************************************************************/
159 UNIV_INTERN
160 dberr_t
162 /*=====================================*/
163  ulint space,
164  const char* name,
165  ulint flags,
166  const char* path,
167  trx_t* trx,
168  bool commit);
170 /********************************************************************/
173 UNIV_INTERN
174 dberr_t
176 /*==================================*/
177  const char* name,
178  const dict_foreign_t* foreign,
179  trx_t* trx)
180  __attribute__((nonnull, warn_unused_result));
181 
182 /* Table create node structure */
183 struct tab_node_t{
187  ins_node_t* tab_def; /* child node which does the insert of
188  the table definition; the row to be inserted
189  is built by the parent node */
190  ins_node_t* col_def; /* child node which does the inserts of
191  the column definitions; the row to be inserted
192  is built by the parent node */
193  commit_node_t* commit_node;
194  /* child node which performs a commit after
195  a successful table creation */
196  /*----------------------*/
197  /* Local storage for this graph node */
198  ulint state;
199  ulint col_no;
201 };
202 
203 /* Table create node states */
204 #define TABLE_BUILD_TABLE_DEF 1
205 #define TABLE_BUILD_COL_DEF 2
206 #define TABLE_COMMIT_WORK 3
207 #define TABLE_ADD_TO_CACHE 4
208 #define TABLE_COMPLETED 5
209 
210 /* Index create node struct */
211 
212 struct ind_node_t{
216  ins_node_t* ind_def; /* child node which does the insert of
217  the index definition; the row to be inserted
218  is built by the parent node */
219  ins_node_t* field_def; /* child node which does the inserts of
220  the field definitions; the row to be inserted
221  is built by the parent node */
222  commit_node_t* commit_node;
223  /* child node which performs a commit after
224  a successful index creation */
225  /*----------------------*/
226  /* Local storage for this graph node */
227  ulint state;
228  ulint page_no;/* root page number of the index */
230  dtuple_t* ind_row;/* index definition row built */
231  ulint field_no;/* next field definition to insert */
233 };
234 
235 /* Index create node states */
236 #define INDEX_BUILD_INDEX_DEF 1
237 #define INDEX_BUILD_FIELD_DEF 2
238 #define INDEX_CREATE_INDEX_TREE 3
239 #define INDEX_COMMIT_WORK 4
240 #define INDEX_ADD_TO_CACHE 5
241 
242 #ifndef UNIV_NONINL
243 #include "dict0crea.ic"
244 #endif
245 
246 #endif