27 #if defined(BUILD_DRIZZLE)
30 # include "mysql_version.h"
35 #include "dict0load.ic"
51 static const char* SYSTEM_TABLE_NAME[] = {
72 dict_index_get_nth_field(
110 dfield = dtuple_get_nth_field(tuple, 0);
115 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
118 rec = btr_pcur_get_rec(&pcur);
130 field = rec_get_nth_field_old(rec, 0, &len);
132 if (len < strlen(name)
133 ||
ut_memcmp(name, field, strlen(name)) != 0) {
147 char* table_name =
mem_strdupl((
char*) field, len);
178 mutex_enter(&kernel_mutex);
179 srv_fatal_semaphore_wait_threshold += 7200;
180 mutex_exit(&kernel_mutex);
203 fprintf(stderr,
" InnoDB: %s\n", err_msg);
217 mutex_enter(&kernel_mutex);
218 srv_fatal_semaphore_wait_threshold -= 7200;
219 mutex_exit(&kernel_mutex);
228 dict_getnext_system_low(
239 rec = btr_pcur_get_rec(pcur);
265 dict_system_id_t system_id)
271 ut_a(system_id < SYS_NUM_SYSTEM_TABLES);
280 rec = dict_getnext_system_low(pcur, mtr);
302 rec = dict_getnext_system_low(pcur, mtr);
318 dict_table_info_t status)
325 const char* err_msg = NULL;
328 field = (
const char*) rec_get_nth_field_old(rec, 0, &len);
341 err_msg =
"Table not found in cache";
352 && dict_table_get_first_index(*table)) {
376 table_id_t* table_id)
385 heap, rec, FALSE, &index);
402 table_id_t* table_id,
403 const char** col_name)
409 table_id, col_name, rec);
426 index_id_t* index_id,
435 last_index_id =
static_cast<unsigned char *
>(
mem_heap_alloc(heap, 8));
439 pos, last_index_id, heap, rec);
463 ulint n_fields_and_type;
466 return(
"delete-marked record in SYS_FOREIGN");
470 return(
"wrong number of columns in SYS_FOREIGN record");
473 field = rec_get_nth_field_old(rec, 0, &len);
474 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
476 return(
"incorrect column length in SYS_FOREIGN");
486 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
490 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
497 field = rec_get_nth_field_old(rec, 3, &len);
498 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
502 heap, (
const char*) field, len);
504 field = rec_get_nth_field_old(rec, 4, &len);
505 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
509 heap, (
const char*) field, len);
511 field = rec_get_nth_field_old(rec, 5, &len);
512 if (UNIV_UNLIKELY(len != 4)) {
517 foreign->
type = (
unsigned int) (n_fields_and_type >> 24);
518 foreign->
n_fields = (
unsigned int) (n_fields_and_type & 0x3FFUL);
534 const char** for_col_name,
535 const char** ref_col_name,
543 return(
"delete-marked record in SYS_FOREIGN_COLS");
547 return(
"wrong number of columns in SYS_FOREIGN_COLS record");
550 field = rec_get_nth_field_old(rec, 0, &len);
551 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
553 return(
"incorrect column length in SYS_FOREIGN_COLS");
557 field = rec_get_nth_field_old(rec, 1, &len);
558 if (UNIV_UNLIKELY(len != 4)) {
564 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
568 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
572 field = rec_get_nth_field_old(rec, 4, &len);
573 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
578 field = rec_get_nth_field_old(rec, 5, &len);
579 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
591 UNIV_INTERN
void dict_print_with_callback(dict_print_callback func,
void *func_arg)
604 mutex_enter(&kernel_mutex);
605 srv_fatal_semaphore_wait_threshold += 7200;
606 mutex_exit(&kernel_mutex);
620 rec = btr_pcur_get_rec(&pcur);
632 mutex_enter(&kernel_mutex);
633 srv_fatal_semaphore_wait_threshold -= 7200;
634 mutex_exit(&kernel_mutex);
639 field = rec_get_nth_field_old(rec, 0, &len);
645 char* table_name =
mem_strdupl((
char*) field, len);
651 func(func_arg, table_name);
668 dict_sys_tables_get_flags(
677 field = rec_get_nth_field_old(rec, 5, &len);
686 field = rec_get_nth_field_old(rec, 4, &len);
689 if (UNIV_UNLIKELY(!(n_cols & 0x80000000UL))) {
691 return(ULINT_UNDEFINED);
700 return(ULINT_UNDEFINED);
703 #if DICT_TF_FORMAT_MAX > DICT_TF_FORMAT_ZIP
704 # error "missing case labels for DICT_TF_FORMAT_ZIP .. DICT_TF_FORMAT_MAX"
710 if (UNIV_UNLIKELY((flags & DICT_TF_ZSSIZE_MASK)
713 return(ULINT_UNDEFINED);
716 if (UNIV_UNLIKELY(flags & (SIZE_MAX <<
DICT_TF_BITS))) {
718 return(ULINT_UNDEFINED);
736 ibool in_crash_recovery)
754 + DICT_HDR_MAX_SPACE_ID,
763 rec = btr_pcur_get_rec(&pcur);
792 field = rec_get_nth_field_old(rec, 0, &len);
795 flags = dict_sys_tables_get_flags(rec);
796 if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) {
798 field = rec_get_nth_field_old(rec, 5, &len);
802 fputs(
" InnoDB: Error: table ", stderr);
805 "InnoDB: in InnoDB data dictionary"
806 " has unknown type %lx.\n",
812 field = rec_get_nth_field_old(rec, 9, &len);
823 }
else if (in_crash_recovery) {
829 field = rec_get_nth_field_old(rec, 4, &len);
833 field = rec_get_nth_field_old(rec, 7, &len);
848 space_id, name, is_temp, TRUE, !is_temp);
859 if (space_id > max_space_id) {
860 max_space_id = space_id;
887 table_id_t* table_id,
888 const char** col_name,
899 ut_ad(table || column);
902 return(
"delete-marked record in SYS_COLUMNS");
906 return(
"wrong number of columns in SYS_COLUMNS record");
909 field = rec_get_nth_field_old(rec, 0, &len);
910 if (UNIV_UNLIKELY(len != 8)) {
912 return(
"incorrect column length in SYS_COLUMNS");
918 return(
"SYS_COLUMNS.TABLE_ID mismatch");
921 field = rec_get_nth_field_old(rec, 1, &len);
922 if (UNIV_UNLIKELY(len != 4)) {
929 if (UNIV_UNLIKELY(table && table->
n_def != pos)) {
930 return(
"SYS_COLUMNS.POS mismatch");
934 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
938 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
942 field = rec_get_nth_field_old(rec, 4, &len);
943 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
953 field = rec_get_nth_field_old(rec, 5, &len);
954 if (UNIV_UNLIKELY(len != 4)) {
960 field = rec_get_nth_field_old(rec, 6, &len);
961 if (UNIV_UNLIKELY(len != 4)) {
976 DATA_MYSQL_BINARY_CHARSET_COLL);
983 data_mysql_default_charset_coll);
987 field = rec_get_nth_field_old(rec, 7, &len);
988 if (UNIV_UNLIKELY(len != 4)) {
992 field = rec_get_nth_field_old(rec, 8, &len);
993 if (UNIV_UNLIKELY(len != 4)) {
1036 ut_a(name_of_col_is(sys_columns, sys_index, 4,
"NAME"));
1037 ut_a(name_of_col_is(sys_columns, sys_index, 8,
"PREC"));
1040 dfield = dtuple_get_nth_field(tuple, 0);
1048 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
1050 for (i = 0; i + DATA_N_SYS_COLS < (ulint) table->
n_cols; i++) {
1051 const char* err_msg;
1053 rec = btr_pcur_get_rec(&pcur);
1061 fprintf(stderr,
"InnoDB: %s\n", err_msg);
1073 static const char* dict_load_field_del =
"delete-marked record in SYS_FIELDS";
1093 byte* last_index_id,
1100 ulint pos_and_prefix_len;
1106 ut_a((!index) || (!sys_field));
1109 return(dict_load_field_del);
1113 return(
"wrong number of columns in SYS_FIELDS record");
1116 field = rec_get_nth_field_old(rec, 0, &len);
1117 if (UNIV_UNLIKELY(len != 8)) {
1119 return(
"incorrect column length in SYS_FIELDS");
1123 ut_a(last_index_id);
1124 memcpy(index_id, (
const char*)field, 8);
1125 first_field = memcmp(index_id, last_index_id, 8);
1127 first_field = (index->
n_def == 0);
1128 if (memcmp(field, index_id, 8)) {
1129 return(
"SYS_FIELDS.INDEX_ID mismatch");
1133 field = rec_get_nth_field_old(rec, 1, &len);
1134 if (UNIV_UNLIKELY(len != 4)) {
1139 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
1143 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
1157 if (index && UNIV_UNLIKELY
1158 ((pos_and_prefix_len & 0xFFFFUL) != index->
n_def
1159 && (pos_and_prefix_len >> 16 & 0xFFFF) != index->
n_def)) {
1160 return(
"SYS_FIELDS.POS mismatch");
1163 if (first_field || pos_and_prefix_len > 0xFFFFUL) {
1164 prefix_len = pos_and_prefix_len & 0xFFFFUL;
1165 position = (pos_and_prefix_len & 0xFFFF0000UL) >> 16;
1168 position = pos_and_prefix_len & 0xFFFFUL;
1171 field = rec_get_nth_field_old(rec, 4, &len);
1172 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
1185 heap, (
const char*) field, len);
1221 ut_a(name_of_col_is(sys_fields, sys_index, 4,
"COL_NAME"));
1224 dfield = dtuple_get_nth_field(tuple, 0);
1232 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
1234 for (i = 0; i < index->
n_fields; i++) {
1235 const char* err_msg;
1237 rec = btr_pcur_get_rec(&pcur);
1244 if (err_msg == dict_load_field_del) {
1250 }
else if (err_msg) {
1251 fprintf(stderr,
"InnoDB: %s\n", err_msg);
1252 error = DB_CORRUPTION;
1267 static const char* dict_load_index_del =
"delete-marked record in SYS_INDEXES";
1269 static const char* dict_load_index_id_err =
"SYS_INDEXES.TABLE_ID mismatch";
1284 const char* table_name,
1308 return(dict_load_index_del);
1312 return(
"wrong number of columns in SYS_INDEXES record");
1315 field = rec_get_nth_field_old(rec, 0, &len);
1316 if (UNIV_UNLIKELY(len != 8)) {
1318 return(
"incorrect column length in SYS_INDEXES");
1323 memcpy(table_id, (
const char*)field, 8);
1324 }
else if (memcmp(field, table_id, 8)) {
1327 return(dict_load_index_id_err);
1330 field = rec_get_nth_field_old(rec, 1, &len);
1331 if (UNIV_UNLIKELY(len != 8)) {
1338 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
1342 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
1346 field = rec_get_nth_field_old(rec, 4, &name_len);
1347 if (UNIV_UNLIKELY(name_len == UNIV_SQL_NULL)) {
1354 field = rec_get_nth_field_old(rec, 5, &len);
1355 if (UNIV_UNLIKELY(len != 4)) {
1360 field = rec_get_nth_field_old(rec, 6, &len);
1361 if (UNIV_UNLIKELY(len != 4)) {
1366 field = rec_get_nth_field_old(rec, 7, &len);
1367 if (UNIV_UNLIKELY(len != 4)) {
1372 field = rec_get_nth_field_old(rec, 8, &len);
1373 if (UNIV_UNLIKELY(len != 4)) {
1379 space, type, n_fields);
1384 space, type, n_fields);
1389 ut_ad((*index)->page);
1405 dict_err_ignore_t ignore_err)
1417 ulint error = DB_SUCCESS;
1426 ut_a(name_of_col_is(sys_indexes, sys_index, 4,
"NAME"));
1427 ut_a(name_of_col_is(sys_indexes, sys_index, 8,
"PAGE_NO"));
1430 dfield = dtuple_get_nth_field(tuple, 0);
1438 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
1442 const char* err_msg;
1449 rec = btr_pcur_get_rec(&pcur);
1453 ut_ad((index == NULL) == (err_msg != NULL));
1455 if (err_msg == dict_load_index_id_err) {
1459 }
else if (err_msg == dict_load_index_del) {
1462 }
else if (err_msg) {
1463 fprintf(stderr,
"InnoDB: %s\n", err_msg);
1464 error = DB_CORRUPTION;
1475 "InnoDB: Error: unknown type %lu"
1476 " of index %s of table %s\n",
1479 error = DB_UNSUPPORTED;
1485 "InnoDB: Error: trying to load index %s"
1487 "InnoDB: but the index tree has been freed!\n",
1498 "InnoDB: Index is corrupt but forcing"
1499 " load into data dictionary\n");
1503 error = DB_CORRUPTION;
1507 && NULL == dict_table_get_first_index(table)) {
1509 fputs(
"InnoDB: Error: trying to load index ",
1512 fputs(
" for table ", stderr);
1514 fputs(
"\nInnoDB: but the first index"
1515 " is not clustered!\n", stderr);
1518 }
else if (table->
id < DICT_HDR_FIRST_ID
1521 && !strcmp(
"ID_IND", index->
name)))) {
1527 dict_load_fields(index, heap);
1529 index->
page, FALSE);
1535 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
1571 return(
"delete-marked record in SYS_TABLES");
1575 return(
"wrong number of columns in SYS_TABLES record");
1579 if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
1581 return(
"incorrect column length in SYS_TABLES");
1584 if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) {
1588 if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) {
1593 if (UNIV_UNLIKELY(len != 8)) {
1597 field = rec_get_nth_field_old(rec, 4, &len);
1598 if (UNIV_UNLIKELY(len != 4)) {
1605 if (UNIV_UNLIKELY(len != 4)) {
1610 if (UNIV_UNLIKELY(len != 8)) {
1615 if (UNIV_UNLIKELY(len != 4)) {
1620 if (UNIV_UNLIKELY(len != UNIV_SQL_NULL)) {
1624 field = rec_get_nth_field_old(rec, 9, &len);
1626 if (UNIV_UNLIKELY(len != 4)) {
1634 flags = dict_sys_tables_get_flags(rec);
1636 if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) {
1637 field = rec_get_nth_field_old(rec, 5, &len);
1642 fputs(
" InnoDB: Error: table ", stderr);
1644 fprintf(stderr,
"\n"
1645 "InnoDB: in InnoDB data dictionary"
1646 " has unknown type %lx.\n",
1648 return(
"incorrect flags in SYS_TABLES");
1656 if (n_cols & 0x80000000UL) {
1661 field = rec_get_nth_field_old(rec, 7, &len);
1663 if (UNIV_UNLIKELY(len != 4)) {
1672 fputs(
" InnoDB: Warning: table ", stderr);
1674 fprintf(stderr,
"\n"
1675 "InnoDB: in InnoDB data dictionary"
1676 " has unknown flags %lx.\n",
1689 field = rec_get_nth_field_old(rec, 3, &len);
1694 (*table)->ibd_file_missing = FALSE;
1715 dict_err_ignore_t ignore_err)
1730 const char* err_msg;
1742 ut_a(name_of_col_is(sys_tables, sys_index, 3,
"ID"));
1743 ut_a(name_of_col_is(sys_tables, sys_index, 4,
"N_COLS"));
1744 ut_a(name_of_col_is(sys_tables, sys_index, 5,
"TYPE"));
1745 ut_a(name_of_col_is(sys_tables, sys_index, 7,
"MIX_LEN"));
1746 ut_a(name_of_col_is(sys_tables, sys_index, 9,
"SPACE"));
1749 dfield = dtuple_get_nth_field(tuple, 0);
1754 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
1756 rec = btr_pcur_get_rec(&pcur);
1769 field = rec_get_nth_field_old(rec, 0, &len);
1782 fprintf(stderr,
" InnoDB: %s\n", err_msg);
1786 if (table->
space == 0) {
1800 " InnoDB: error: space object of table ");
1802 fprintf(stderr,
",\n"
1803 "InnoDB: space id %lu did not exist in memory."
1804 " Retrying an open.\n",
1805 (ulong) table->
space);
1822 dict_load_columns(table, heap);
1832 err = dict_load_indexes(table, heap, ignore_err);
1843 }
else if (err == DB_SUCCESS) {
1846 if (err != DB_SUCCESS) {
1852 }
else if (!srv_force_recovery) {
1857 if (err != DB_SUCCESS && table != NULL) {
1859 mutex_enter(&dict_foreign_err_mutex);
1864 " InnoDB: Error: could not make a foreign key"
1865 " definition to match\n"
1866 "InnoDB: the foreign key table"
1867 " or the referenced table!\n"
1868 "InnoDB: The data dictionary of InnoDB is corrupt."
1869 " You may need to drop\n"
1870 "InnoDB: and recreate the foreign key table"
1871 " or the referenced table.\n"
1872 "InnoDB: Submit a detailed bug report"
1873 " to http://bugs.mysql.com\n"
1874 "InnoDB: Latest foreign key error printout:\n%s\n",
1875 dict_foreign_err_buf);
1877 mutex_exit(&dict_foreign_err_mutex);
1892 table_id_t table_id)
1921 sys_table_ids = dict_table_get_next_index(
1922 dict_table_get_first_index(sys_tables));
1927 dfield = dtuple_get_nth_field(tuple, 0);
1935 btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE,
1937 rec = btr_pcur_get_rec(&pcur);
1949 rec = btr_pcur_get_rec(&pcur);
1956 rec = btr_pcur_get_rec(&pcur);
1957 field = rec_get_nth_field_old(rec, 0, &len);
1966 field = rec_get_nth_field_old(rec, 1, &len);
2003 dict_load_foreign_cols(
2034 dfield = dtuple_get_nth_field(tuple, 0);
2039 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
2041 for (i = 0; i < foreign->
n_fields; i++) {
2043 rec = btr_pcur_get_rec(&pcur);
2048 field = rec_get_nth_field_old(rec, 0, &len);
2052 field = rec_get_nth_field_old(rec, 1, &len);
2056 field = rec_get_nth_field_old(rec, 4, &len);
2058 foreign->
heap, (
char*) field, len);
2060 field = rec_get_nth_field_old(rec, 5, &len);
2062 foreign->
heap, (
char*) field, len);
2080 ibool check_charsets,
2082 ibool check_recursive)
2097 ulint n_fields_and_type;
2113 dfield = dtuple_get_nth_field(tuple, 0);
2118 btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
2120 rec = btr_pcur_get_rec(&pcur);
2127 "InnoDB: Error A: cannot load foreign constraint %s\n",
2137 field = rec_get_nth_field_old(rec, 0, &len);
2143 "InnoDB: Error B: cannot load foreign constraint %s\n",
2161 rec_get_nth_field_old(rec, 5, &len));
2167 foreign->
type = (
unsigned int) (n_fields_and_type >> 24);
2168 foreign->
n_fields = (
unsigned int) (n_fields_and_type & 0x3FFUL);
2172 field = rec_get_nth_field_old(rec, 3, &len);
2175 foreign->
heap, (
char*) field, len);
2178 field = rec_get_nth_field_old(rec, 4, &len);
2180 foreign->
heap, (
char*) field, len);
2186 dict_load_foreign_cols(
id, foreign);
2224 if (for_table && ref_table && check_recursive) {
2259 const char* table_name,
2260 ibool check_recursive,
2262 ibool check_charsets)
2282 if (sys_foreign == NULL) {
2286 "InnoDB: Error: no foreign key system tables"
2287 " in the database\n");
2298 sec_index = dict_table_get_next_index(
2299 dict_table_get_first_index(sys_foreign));
2304 dfield = dtuple_get_nth_field(tuple, 0);
2309 btr_pcur_open_on_user_rec(sec_index, tuple, PAGE_CUR_GE,
2312 rec = btr_pcur_get_rec(&pcur);
2317 goto load_next_index;
2323 rec = btr_pcur_get_rec(&pcur);
2324 field = rec_get_nth_field_old(rec, 0, &len);
2331 dfield_get_type(dfield)->prtype,
2332 static_cast<const unsigned char *>(dfield_get_data(dfield)),
2336 goto load_next_index;
2346 if ((srv_lower_case_table_names != 2)
2347 && (0 !=
ut_memcmp(field, table_name, len))) {
2357 field = rec_get_nth_field_old(rec, 1, &len);
2366 err = dict_load_foreign(
id, check_charsets, check_recursive);
2368 if (err != DB_SUCCESS) {
2388 sec_index = dict_table_get_next_index(sec_index);
2390 if (sec_index != NULL) {
2397 check_recursive = FALSE;
dict_table_t * sys_tables
UNIV_INTERN ibool dtype_is_string_type(ulint mtype)
UNIV_INTERN void dict_mem_index_add_field(dict_index_t *index, const char *name, ulint prefix_len)
UNIV_INTERN void dict_table_add_to_cache(dict_table_t *table, mem_heap_t *heap)
UNIV_INLINE ibool btr_pcur_is_on_user_rec(const btr_pcur_t *cursor)
UNIV_INTERN const char * dict_table_get_col_name(const dict_table_t *table, ulint col_nr)
UNIV_INTERN const char * dict_load_table_low(const char *name, const rec_t *rec, dict_table_t **table)
#define DICT_TF_FORMAT_SHIFT
char * foreign_table_name_lookup
UNIV_INTERN const char * dict_process_sys_foreign_rec(mem_heap_t *heap, const rec_t *rec, dict_foreign_t *foreign)
char * foreign_table_name
UNIV_INTERN const char * dict_load_column_low(dict_table_t *table, mem_heap_t *heap, dict_col_t *column, table_id_t *table_id, const char **col_name, const rec_t *rec)
UNIV_INTERN dict_table_t * dict_load_table_on_id(table_id_t table_id)
UNIV_INTERN ulint rec_get_nth_field_offs_old(const rec_t *rec, ulint n, ulint *len)
UNIV_INLINE void dict_mem_fill_index_struct(dict_index_t *index, mem_heap_t *heap, const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
UNIV_INTERN const char * dict_process_sys_fields_rec(mem_heap_t *heap, const rec_t *rec, dict_field_t *sys_field, ulint *pos, index_id_t *index_id, index_id_t last_id)
UNIV_INLINE dtuple_t * dtuple_create(mem_heap_t *heap, ulint n_fields)
UNIV_INTERN const char * dict_process_sys_foreign_col_rec(mem_heap_t *heap, const rec_t *rec, const char **name, const char **for_col_name, const char **ref_col_name, ulint *pos)
UNIV_INLINE ulint rec_get_n_fields_old(const rec_t *rec)
UNIV_INTERN void dict_load_sys_table(dict_table_t *table)
UNIV_INTERN void ut_print_filename(FILE *f, const char *name)
UNIV_INTERN dict_table_t * dict_load_table(const char *name, ibool cached, dict_err_ignore_t ignore_err)
char * referenced_table_name_lookup
UNIV_INTERN const char * dict_load_field_low(byte *index_id, dict_index_t *index, dict_field_t *sys_field, ulint *pos, byte *last_index_id, mem_heap_t *heap, const rec_t *rec)
UNIV_INTERN ibool fil_open_single_table_tablespace(ibool check_space_id, ulint id, ulint flags, const char *name)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INTERN void dict_table_print_low(dict_table_t *table)
UNIV_INLINE void mach_write_to_8(byte *b, ib_uint64_t n)
UNIV_INTERN dict_index_t * dict_mem_index_create(const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
#define DICT_TF_FORMAT_51
#define DICT_TF_FORMAT_ZIP
#define mem_heap_free(heap)
#define DICT_TF_ZSSIZE_SHIFT
UNIV_INTERN void dict_update_statistics(dict_table_t *table, ibool only_calc_if_missing_stats)
UNIV_INLINE dict_table_t * dict_table_get_low(const char *table_name)
UNIV_INTERN void dict_index_copy_types(dtuple_t *tuple, const dict_index_t *index, ulint n_fields)
char * referenced_table_name
UNIV_INTERN dict_hdr_t * dict_hdr_get(mtr_t *mtr)
UNIV_INTERN void dict_check_tablespaces_and_store_max_id(ibool in_crash_recovery)
UNIV_INLINE void btr_pcur_close(btr_pcur_t *cursor)
UNIV_INTERN char * mem_heap_strdup(mem_heap_t *heap, const char *str)
UNIV_INLINE ulint rec_get_deleted_flag(const rec_t *rec, ulint comp)
UNIV_INTERN char * dict_get_first_table_name_in_db(const char *name)
UNIV_INTERN void dict_mem_fill_column_struct(dict_col_t *column, ulint col_pos, ulint mtype, ulint prtype, ulint col_len)
UNIV_INTERN void mtr_commit(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void dfield_set_data(dfield_t *field, const void *data, ulint len)
const char ** referenced_col_names
UNIV_INTERN ulint mtr_read_ulint(const byte *ptr, ulint type, mtr_t *mtr)
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
UNIV_INTERN const char * dict_load_index_low(byte *table_id, const char *table_name, mem_heap_t *heap, const rec_t *rec, ibool allocate, dict_index_t **index)
UNIV_INLINE int cmp_data_data(ulint mtype, ulint prtype, const byte *data1, ulint len1, const byte *data2, ulint len2)
UNIV_INTERN dict_table_t * dict_mem_table_create(const char *name, ulint space, ulint n_cols, ulint flags)
UNIV_INLINE char * mem_heap_strdupl(mem_heap_t *heap, const char *str, ulint len)
UNIV_INLINE ulint dict_col_get_no(const dict_col_t *col)
UNIV_INLINE ulint dict_index_is_clust(const dict_index_t *index) __attribute__((pure))
#define DICT_FK_MAX_RECURSIVE_LOAD
UNIV_INTERN const rec_t * dict_startscan_system(btr_pcur_t *pcur, mtr_t *mtr, dict_system_id_t system_id)
UNIV_INTERN void btr_pcur_store_position(btr_pcur_t *cursor, mtr_t *mtr)
unsigned fk_max_recusive_level
UNIV_INTERN void dict_table_add_system_columns(dict_table_t *table, mem_heap_t *heap)
UNIV_INTERN void ut_print_name(FILE *f, struct trx_struct *trx, ibool table_id, const char *name)
UNIV_INLINE const dict_col_t * dict_field_get_col(const dict_field_t *field)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_create(N)
UNIV_INTERN void fil_set_max_space_id_if_bigger(ulint max_id)
UNIV_INTERN void dict_mem_table_add_col(dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len)
UNIV_INLINE dict_table_t * dict_table_check_if_in_cache_low(const char *table_name)
#define DICT_TF2_SHIFT
Additional table flags.
#define UT_LIST_GET_FIRST(BASE)
UNIV_INTERN ulint dict_index_add_to_cache(dict_table_t *table, dict_index_t *index, ulint page_no, ibool strict)
UNIV_INTERN void dict_mem_foreign_table_name_lookup_set(dict_foreign_t *foreign, ibool do_alloc)
UNIV_INLINE void mem_heap_empty(mem_heap_t *heap)
UNIV_INTERN void dict_mem_index_free(dict_index_t *index)
unsigned ibd_file_missing
UNIV_INLINE char * mem_strdupl(const char *str, ulint len)
UNIV_INLINE ulint dtype_get_charset_coll(ulint prtype)
UNIV_INTERN const rec_t * dict_getnext_system(btr_pcur_t *pcur, mtr_t *mtr)
UNIV_INLINE ulint mach_read_from_4(const byte *b) __attribute__((nonnull
UNIV_INTERN dict_foreign_t * dict_mem_foreign_create(void)
#define DICT_TABLE_ORDINARY
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INTERN void dict_print(void)
UNIV_INLINE void mtr_start(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE ibool btr_pcur_move_to_next_user_rec(btr_pcur_t *cursor, mtr_t *mtr)
UNIV_INTERN void dict_mem_referenced_table_name_lookup_set(dict_foreign_t *foreign, ibool do_alloc)
UNIV_INTERN const char * dict_process_sys_columns_rec(mem_heap_t *heap, const rec_t *rec, dict_col_t *column, table_id_t *table_id, const char **col_name)
UNIV_INTERN const char * dict_process_sys_tables_rec(mem_heap_t *heap, const rec_t *rec, dict_table_t **table, dict_table_info_t status)
UNIV_INTERN ibool fil_space_for_table_exists_in_mem(ulint id, const char *name, ibool is_temp, ibool mark_space, ibool print_error_if_does_not_exist)
UNIV_INLINE void btr_pcur_open_at_index_side(ibool from_left, dict_index_t *index, ulint latch_mode, btr_pcur_t *pcur, ibool do_init, mtr_t *mtr)
UNIV_INLINE int ut_memcmp(const void *str1, const void *str2, ulint n)
UNIV_INTERN ulint dtype_form_prtype(ulint old_prtype, ulint charset_coll)
UNIV_INLINE ib_uint64_t mach_read_from_8(const byte *b) __attribute__((nonnull
const char ** foreign_col_names
UNIV_INTERN const char * dict_process_sys_indexes_rec(mem_heap_t *heap, const rec_t *rec, dict_index_t *index, table_id_t *table_id)
#define DICT_TF2_TEMPORARY
UNIV_INTERN ibool dtype_is_binary_string_type(ulint mtype, ulint prtype)
UNIV_INTERN ulint dict_foreign_add_to_cache(dict_foreign_t *foreign, ibool check_charsets)
UNIV_INTERN ulint dict_load_foreigns(const char *table_name, ibool check_recursive, ibool check_charsets)
UNIV_INLINE ulint ut_strlen(const char *str)
UNIV_INTERN void dict_table_remove_from_cache(dict_table_t *table)