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  dict_err_ignore_t ignore_err);
178 /***********************************************************************/
181 UNIV_INTERN
183 dict_load_table_on_id(
184 /*==================*/
185  table_id_t table_id);
186 /********************************************************************/
190 UNIV_INTERN
191 void
192 dict_load_sys_table(
193 /*================*/
194  dict_table_t* table);
195 /***********************************************************************/
202 UNIV_INTERN
203 ulint
204 dict_load_foreigns(
205 /*===============*/
206  const char* table_name,
207  ibool check_recursive,
209  ibool check_charsets);
211 /********************************************************************/
214 UNIV_INTERN
215 void
216 dict_print(void);
217 /*============*/
218 
219 typedef void (*dict_print_callback)(void *ptr, const char *);
220 UNIV_INTERN void dict_print_with_callback(dict_print_callback, void *);
221 
222 
223 /********************************************************************/
226 UNIV_INTERN
227 const rec_t*
228 dict_startscan_system(
229 /*==================*/
230  btr_pcur_t* pcur,
232  mtr_t* mtr,
233  dict_system_id_t system_id);
234 /********************************************************************/
237 UNIV_INTERN
238 const rec_t*
239 dict_getnext_system(
240 /*================*/
241  btr_pcur_t* pcur,
243  mtr_t* mtr);
244 /********************************************************************/
249 UNIV_INTERN
250 const char*
251 dict_process_sys_tables_rec(
252 /*========================*/
253  mem_heap_t* heap,
254  const rec_t* rec,
255  dict_table_t** table,
256  dict_table_info_t status);
260 /********************************************************************/
265 UNIV_INTERN
266 const char*
267 dict_process_sys_indexes_rec(
268 /*=========================*/
269  mem_heap_t* heap,
270  const rec_t* rec,
271  dict_index_t* index,
273  table_id_t* table_id);
274 /********************************************************************/
278 UNIV_INTERN
279 const char*
280 dict_process_sys_columns_rec(
281 /*=========================*/
282  mem_heap_t* heap,
283  const rec_t* rec,
284  dict_col_t* column,
285  table_id_t* table_id,
286  const char** col_name);
287 /********************************************************************/
291 UNIV_INTERN
292 const char*
293 dict_process_sys_fields_rec(
294 /*========================*/
295  mem_heap_t* heap,
296  const rec_t* rec,
297  dict_field_t* sys_field,
299  ulint* pos,
300  index_id_t* index_id,
301  index_id_t last_id);
302 /********************************************************************/
307 UNIV_INTERN
308 const char*
309 dict_process_sys_foreign_rec(
310 /*=========================*/
311  mem_heap_t* heap,
312  const rec_t* rec,
313  dict_foreign_t* foreign);
315 /********************************************************************/
319 UNIV_INTERN
320 const char*
321 dict_process_sys_foreign_col_rec(
322 /*=============================*/
323  mem_heap_t* heap,
324  const rec_t* rec,
325  const char** name,
326  const char** for_col_name,
327  const char** ref_col_name,
329  ulint* pos);
330 #ifndef UNIV_NONINL
331 #include "dict0load.ic"
332 #endif
333 
334 #endif