83
54
dict_get_first_table_name_in_db(
84
55
/*============================*/
85
56
const char* name); /*!< in: database name which ends to '/' */
87
/********************************************************************//**
88
Loads a table definition from a SYS_TABLES record to dict_table_t.
89
Does not load any columns or indexes.
90
@return error message, or NULL on success */
95
const char* name, /*!< in: table name */
96
const rec_t* rec, /*!< in: SYS_TABLES record */
97
dict_table_t** table); /*!< out,own: table, or NULL */
98
/********************************************************************//**
99
Loads a table column definition from a SYS_COLUMNS record to
101
@return error message, or NULL on success */
104
dict_load_column_low(
105
/*=================*/
106
dict_table_t* table, /*!< in/out: table, could be NULL
107
if we just populate a dict_column_t
108
struct with information from
109
a SYS_COLUMNS record */
110
mem_heap_t* heap, /*!< in/out: memory heap
111
for temporary storage */
112
dict_col_t* column, /*!< out: dict_column_t to fill,
113
or NULL if table != NULL */
114
table_id_t* table_id, /*!< out: table id */
115
const char** col_name, /*!< out: column name */
116
const rec_t* rec); /*!< in: SYS_COLUMNS record */
117
/********************************************************************//**
118
Loads an index definition from a SYS_INDEXES record to dict_index_t.
119
If allocate=TRUE, we will create a dict_index_t structure and fill it
120
accordingly. If allocated=FALSE, the dict_index_t will be supplied by
121
the caller and filled with information read from the record. @return
122
error message, or NULL on success */
127
byte* table_id, /*!< in/out: table id (8 bytes),
128
an "in" value if allocate=TRUE
129
and "out" when allocate=FALSE */
130
const char* table_name, /*!< in: table name */
131
mem_heap_t* heap, /*!< in/out: temporary memory heap */
132
const rec_t* rec, /*!< in: SYS_INDEXES record */
133
ibool allocate, /*!< in: TRUE=allocate *index,
134
FALSE=fill in a pre-allocated
136
dict_index_t** index); /*!< out,own: index, or NULL */
137
/********************************************************************//**
138
Loads an index field definition from a SYS_FIELDS record to
140
@return error message, or NULL on success */
145
byte* index_id, /*!< in/out: index id (8 bytes)
146
an "in" value if index != NULL
147
and "out" if index == NULL */
148
dict_index_t* index, /*!< in/out: index, could be NULL
149
if we just populate a dict_field_t
150
struct with information from
151
a SYS_FIELDS record */
152
dict_field_t* sys_field, /*!< out: dict_field_t to be
154
ulint* pos, /*!< out: Field position */
155
byte* last_index_id, /*!< in: last index id */
156
mem_heap_t* heap, /*!< in/out: memory heap
157
for temporary storage */
158
const rec_t* rec); /*!< in: SYS_FIELDS record */
159
57
/********************************************************************//**
160
58
Loads a table definition and also all its index definitions, and also
161
59
the cluster definition if the table is a member in a cluster. Also loads
216
111
UNIV_INTERN void dict_print_with_callback(dict_print_callback, void *);
219
/********************************************************************//**
220
This function opens a system table, and return the first record.
221
@return first record of the system table */
224
dict_startscan_system(
225
/*==================*/
226
btr_pcur_t* pcur, /*!< out: persistent cursor to
228
mtr_t* mtr, /*!< in: the mini-transaction */
229
dict_system_id_t system_id); /*!< in: which system table to open */
230
/********************************************************************//**
231
This function get the next system table record as we scan the table.
232
@return the record if found, NULL if end of scan. */
237
btr_pcur_t* pcur, /*!< in/out: persistent cursor
239
mtr_t* mtr); /*!< in: the mini-transaction */
240
/********************************************************************//**
241
This function processes one SYS_TABLES record and populate the dict_table_t
242
struct for the table. Extracted out of dict_print() to be used by
243
both monitor table output and information schema innodb_sys_tables output.
244
@return error message, or NULL on success */
247
dict_process_sys_tables_rec(
248
/*========================*/
249
mem_heap_t* heap, /*!< in: temporary memory heap */
250
const rec_t* rec, /*!< in: SYS_TABLES record */
251
dict_table_t** table, /*!< out: dict_table_t to fill */
252
dict_table_info_t status); /*!< in: status bit controls
253
options such as whether we shall
254
look for dict_table_t from cache
256
/********************************************************************//**
257
This function parses a SYS_INDEXES record and populate a dict_index_t
258
structure with the information from the record. For detail information
259
about SYS_INDEXES fields, please refer to dict_boot() function.
260
@return error message, or NULL on success */
263
dict_process_sys_indexes_rec(
264
/*=========================*/
265
mem_heap_t* heap, /*!< in/out: heap memory */
266
const rec_t* rec, /*!< in: current SYS_INDEXES rec */
267
dict_index_t* index, /*!< out: dict_index_t to be
269
table_id_t* table_id); /*!< out: table id */
270
/********************************************************************//**
271
This function parses a SYS_COLUMNS record and populate a dict_column_t
272
structure with the information from the record.
273
@return error message, or NULL on success */
276
dict_process_sys_columns_rec(
277
/*=========================*/
278
mem_heap_t* heap, /*!< in/out: heap memory */
279
const rec_t* rec, /*!< in: current SYS_COLUMNS rec */
280
dict_col_t* column, /*!< out: dict_col_t to be filled */
281
table_id_t* table_id, /*!< out: table id */
282
const char** col_name); /*!< out: column name */
283
/********************************************************************//**
284
This function parses a SYS_FIELDS record and populate a dict_field_t
285
structure with the information from the record.
286
@return error message, or NULL on success */
289
dict_process_sys_fields_rec(
290
/*========================*/
291
mem_heap_t* heap, /*!< in/out: heap memory */
292
const rec_t* rec, /*!< in: current SYS_FIELDS rec */
293
dict_field_t* sys_field, /*!< out: dict_field_t to be
295
ulint* pos, /*!< out: Field position */
296
index_id_t* index_id, /*!< out: current index id */
297
index_id_t last_id); /*!< in: previous index id */
298
/********************************************************************//**
299
This function parses a SYS_FOREIGN record and populate a dict_foreign_t
300
structure with the information from the record. For detail information
301
about SYS_FOREIGN fields, please refer to dict_load_foreign() function
302
@return error message, or NULL on success */
305
dict_process_sys_foreign_rec(
306
/*=========================*/
307
mem_heap_t* heap, /*!< in/out: heap memory */
308
const rec_t* rec, /*!< in: current SYS_FOREIGN rec */
309
dict_foreign_t* foreign); /*!< out: dict_foreign_t to be
311
/********************************************************************//**
312
This function parses a SYS_FOREIGN_COLS record and extract necessary
313
information from the record and return to caller.
314
@return error message, or NULL on success */
317
dict_process_sys_foreign_col_rec(
318
/*=============================*/
319
mem_heap_t* heap, /*!< in/out: heap memory */
320
const rec_t* rec, /*!< in: current SYS_FOREIGN_COLS rec */
321
const char** name, /*!< out: foreign key constraint name */
322
const char** for_col_name, /*!< out: referencing column name */
323
const char** ref_col_name, /*!< out: referenced column name
324
in referenced table */
325
ulint* pos); /*!< out: column position */
326
115
#ifndef UNIV_NONINL
327
116
#include "dict0load.ic"