Drizzled Public API Documentation

dict0load.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1996, 2009, Innobase Oy. 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., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
27 #pragma once
28 #ifndef dict0load_h
29 #define dict0load_h
30 
31 #include "univ.i"
32 #include "dict0types.h"
33 #include "ut0byte.h"
34 #include "mem0mem.h"
35 #include "btr0types.h"
36 
39  SYS_TABLES = 0,
40  SYS_INDEXES,
41  SYS_COLUMNS,
42  SYS_FIELDS,
43  SYS_FOREIGN,
44  SYS_FOREIGN_COLS,
45 
46  /* This must be last item. Defines the number of system tables. */
47  SYS_NUM_SYSTEM_TABLES
48 };
49 
50 typedef enum dict_system_table_id dict_system_id_t;
51 
61 };
62 
63 typedef enum dict_table_info dict_table_info_t;
64 
65 /********************************************************************/
73 UNIV_INTERN
74 void
75 dict_check_tablespaces_and_store_max_id(
76 /*====================================*/
77  ibool in_crash_recovery);
78 /********************************************************************/
82 UNIV_INTERN
83 char*
84 dict_get_first_table_name_in_db(
85 /*============================*/
86  const char* name);
88 /********************************************************************/
92 UNIV_INTERN
93 const char*
94 dict_load_table_low(
95 /*================*/
96  const char* name,
97  const rec_t* rec,
98  dict_table_t** table);
99 /********************************************************************/
103 UNIV_INTERN
104 const char*
105 dict_load_column_low(
106 /*=================*/
107  dict_table_t* table,
111  mem_heap_t* heap,
113  dict_col_t* column,
115  table_id_t* table_id,
116  const char** col_name,
117  const rec_t* rec);
118 /********************************************************************/
124 UNIV_INTERN
125 const char*
126 dict_load_index_low(
127 /*================*/
128  byte* table_id,
131  const char* table_name,
132  mem_heap_t* heap,
133  const rec_t* rec,
134  ibool allocate,
137  dict_index_t** index);
138 /********************************************************************/
142 UNIV_INTERN
143 const char*
144 dict_load_field_low(
145 /*================*/
146  byte* index_id,
149  dict_index_t* index,
153  dict_field_t* sys_field,
155  ulint* pos,
156  byte* last_index_id,
157  mem_heap_t* heap,
159  const rec_t* rec);
160 /********************************************************************/
168 UNIV_INTERN
170 dict_load_table(
171 /*============*/
172  const char* name,
174  ibool cached);
175 /***********************************************************************/
178 UNIV_INTERN
180 dict_load_table_on_id(
181 /*==================*/
182  table_id_t table_id);
183 /********************************************************************/
187 UNIV_INTERN
188 void
189 dict_load_sys_table(
190 /*================*/
191  dict_table_t* table);
192 /***********************************************************************/
199 UNIV_INTERN
200 ulint
201 dict_load_foreigns(
202 /*===============*/
203  const char* table_name,
204  ibool check_recursive,
206  ibool check_charsets);
208 /********************************************************************/
211 UNIV_INTERN
212 void
213 dict_print(void);
214 /*============*/
215 
216 typedef void (*dict_print_callback)(void *ptr, const char *);
217 UNIV_INTERN void dict_print_with_callback(dict_print_callback, void *);
218 
219 
220 /********************************************************************/
223 UNIV_INTERN
224 const rec_t*
225 dict_startscan_system(
226 /*==================*/
227  btr_pcur_t* pcur,
229  mtr_t* mtr,
230  dict_system_id_t system_id);
231 /********************************************************************/
234 UNIV_INTERN
235 const rec_t*
236 dict_getnext_system(
237 /*================*/
238  btr_pcur_t* pcur,
240  mtr_t* mtr);
241 /********************************************************************/
246 UNIV_INTERN
247 const char*
248 dict_process_sys_tables_rec(
249 /*========================*/
250  mem_heap_t* heap,
251  const rec_t* rec,
252  dict_table_t** table,
253  dict_table_info_t status);
257 /********************************************************************/
262 UNIV_INTERN
263 const char*
264 dict_process_sys_indexes_rec(
265 /*=========================*/
266  mem_heap_t* heap,
267  const rec_t* rec,
268  dict_index_t* index,
270  table_id_t* table_id);
271 /********************************************************************/
275 UNIV_INTERN
276 const char*
277 dict_process_sys_columns_rec(
278 /*=========================*/
279  mem_heap_t* heap,
280  const rec_t* rec,
281  dict_col_t* column,
282  table_id_t* table_id,
283  const char** col_name);
284 /********************************************************************/
288 UNIV_INTERN
289 const char*
290 dict_process_sys_fields_rec(
291 /*========================*/
292  mem_heap_t* heap,
293  const rec_t* rec,
294  dict_field_t* sys_field,
296  ulint* pos,
297  index_id_t* index_id,
298  index_id_t last_id);
299 /********************************************************************/
304 UNIV_INTERN
305 const char*
306 dict_process_sys_foreign_rec(
307 /*=========================*/
308  mem_heap_t* heap,
309  const rec_t* rec,
310  dict_foreign_t* foreign);
312 /********************************************************************/
316 UNIV_INTERN
317 const char*
318 dict_process_sys_foreign_col_rec(
319 /*=============================*/
320  mem_heap_t* heap,
321  const rec_t* rec,
322  const char** name,
323  const char** for_col_name,
324  const char** ref_col_name,
326  ulint* pos);
327 #ifndef UNIV_NONINL
328 #include "dict0load.ic"
329 #endif
330 
331 #endif