00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #pragma once
00028 #ifndef dict0load_h
00029 #define dict0load_h
00030
00031 #include "univ.i"
00032 #include "dict0types.h"
00033 #include "ut0byte.h"
00034 #include "mem0mem.h"
00035 #include "btr0types.h"
00036
00038 enum dict_system_table_id {
00039 SYS_TABLES = 0,
00040 SYS_INDEXES,
00041 SYS_COLUMNS,
00042 SYS_FIELDS,
00043 SYS_FOREIGN,
00044 SYS_FOREIGN_COLS,
00045
00046
00047 SYS_NUM_SYSTEM_TABLES
00048 };
00049
00050 typedef enum dict_system_table_id dict_system_id_t;
00051
00053 enum dict_table_info {
00054 DICT_TABLE_LOAD_FROM_RECORD = 0,
00057 DICT_TABLE_LOAD_FROM_CACHE = 1,
00059 DICT_TABLE_UPDATE_STATS = 2
00061 };
00062
00063 typedef enum dict_table_info dict_table_info_t;
00064
00065
00073 UNIV_INTERN
00074 void
00075 dict_check_tablespaces_and_store_max_id(
00076
00077 ibool in_crash_recovery);
00078
00082 UNIV_INTERN
00083 char*
00084 dict_get_first_table_name_in_db(
00085
00086 const char* name);
00088
00092 UNIV_INTERN
00093 const char*
00094 dict_load_table_low(
00095
00096 const char* name,
00097 const rec_t* rec,
00098 dict_table_t** table);
00099
00103 UNIV_INTERN
00104 const char*
00105 dict_load_column_low(
00106
00107 dict_table_t* table,
00111 mem_heap_t* heap,
00113 dict_col_t* column,
00115 table_id_t* table_id,
00116 const char** col_name,
00117 const rec_t* rec);
00118
00124 UNIV_INTERN
00125 const char*
00126 dict_load_index_low(
00127
00128 byte* table_id,
00131 const char* table_name,
00132 mem_heap_t* heap,
00133 const rec_t* rec,
00134 ibool allocate,
00137 dict_index_t** index);
00138
00142 UNIV_INTERN
00143 const char*
00144 dict_load_field_low(
00145
00146 byte* index_id,
00149 dict_index_t* index,
00153 dict_field_t* sys_field,
00155 ulint* pos,
00156 byte* last_index_id,
00157 mem_heap_t* heap,
00159 const rec_t* rec);
00160
00168 UNIV_INTERN
00169 dict_table_t*
00170 dict_load_table(
00171
00172 const char* name,
00174 ibool cached);
00175
00178 UNIV_INTERN
00179 dict_table_t*
00180 dict_load_table_on_id(
00181
00182 table_id_t table_id);
00183
00187 UNIV_INTERN
00188 void
00189 dict_load_sys_table(
00190
00191 dict_table_t* table);
00192
00199 UNIV_INTERN
00200 ulint
00201 dict_load_foreigns(
00202
00203 const char* table_name,
00204 ibool check_recursive,
00206 ibool check_charsets);
00208
00211 UNIV_INTERN
00212 void
00213 dict_print(void);
00214
00215
00216 typedef void (*dict_print_callback)(void *ptr, const char *);
00217 UNIV_INTERN void dict_print_with_callback(dict_print_callback, void *);
00218
00219
00220
00223 UNIV_INTERN
00224 const rec_t*
00225 dict_startscan_system(
00226
00227 btr_pcur_t* pcur,
00229 mtr_t* mtr,
00230 dict_system_id_t system_id);
00231
00234 UNIV_INTERN
00235 const rec_t*
00236 dict_getnext_system(
00237
00238 btr_pcur_t* pcur,
00240 mtr_t* mtr);
00241
00246 UNIV_INTERN
00247 const char*
00248 dict_process_sys_tables_rec(
00249
00250 mem_heap_t* heap,
00251 const rec_t* rec,
00252 dict_table_t** table,
00253 dict_table_info_t status);
00257
00262 UNIV_INTERN
00263 const char*
00264 dict_process_sys_indexes_rec(
00265
00266 mem_heap_t* heap,
00267 const rec_t* rec,
00268 dict_index_t* index,
00270 table_id_t* table_id);
00271
00275 UNIV_INTERN
00276 const char*
00277 dict_process_sys_columns_rec(
00278
00279 mem_heap_t* heap,
00280 const rec_t* rec,
00281 dict_col_t* column,
00282 table_id_t* table_id,
00283 const char** col_name);
00284
00288 UNIV_INTERN
00289 const char*
00290 dict_process_sys_fields_rec(
00291
00292 mem_heap_t* heap,
00293 const rec_t* rec,
00294 dict_field_t* sys_field,
00296 ulint* pos,
00297 index_id_t* index_id,
00298 index_id_t last_id);
00299
00304 UNIV_INTERN
00305 const char*
00306 dict_process_sys_foreign_rec(
00307
00308 mem_heap_t* heap,
00309 const rec_t* rec,
00310 dict_foreign_t* foreign);
00312
00316 UNIV_INTERN
00317 const char*
00318 dict_process_sys_foreign_col_rec(
00319
00320 mem_heap_t* heap,
00321 const rec_t* rec,
00322 const char** name,
00323 const char** for_col_name,
00324 const char** ref_col_name,
00326 ulint* pos);
00327 #ifndef UNIV_NONINL
00328 #include "dict0load.ic"
00329 #endif
00330
00331 #endif