Loading innobase/dict/dict0dict.c +34 −4 Original line number Diff line number Diff line Loading @@ -1249,15 +1249,13 @@ dict_table_remove_from_cache( /* Remove table from LRU list of tables */ UT_LIST_REMOVE(table_LRU, dict_sys->table_LRU, table); mutex_free(&(table->autoinc_mutex)); size = mem_heap_get_size(table->heap); ut_ad(dict_sys->size >= size); dict_sys->size -= size; mem_heap_free(table->heap); dict_mem_table_free(table); } /************************************************************************** Loading Loading @@ -1378,6 +1376,38 @@ dict_col_reposition_in_cache( HASH_INSERT(dict_col_t, hash, dict_sys->col_hash, fold, col); } /******************************************************************** If the given column name is reserved for InnoDB system columns, return TRUE. */ ibool dict_col_name_is_reserved( /*======================*/ /* out: TRUE if name is reserved */ const char* name) /* in: column name */ { /* This check reminds that if a new system column is added to the program, it should be dealt with here. */ #if DATA_N_SYS_COLS != 4 #error "DATA_N_SYS_COLS != 4" #endif static const char* reserved_names[] = { "DB_ROW_ID", "DB_TRX_ID", "DB_ROLL_PTR", "DB_MIX_ID" }; ulint i; for (i = 0; i < UT_ARR_SIZE(reserved_names); i++) { if (strcmp(name, reserved_names[i]) == 0) { return(TRUE); } } return(FALSE); } /************************************************************************** Adds an index to the dictionary cache. */ Loading Loading @@ -1551,7 +1581,7 @@ dict_index_remove_from_cache( dict_sys->size -= size; mem_heap_free(index->heap); dict_mem_index_free(index); } /*********************************************************************** Loading innobase/dict/dict0load.c +11 −6 Original line number Diff line number Diff line Loading @@ -767,7 +767,7 @@ dict_load_table( if (!btr_pcur_is_on_user_rec(&pcur, &mtr) || rec_get_deleted_flag(rec, sys_tables->comp)) { /* Not found */ err_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); Loading @@ -779,11 +779,8 @@ dict_load_table( /* Check if the table name in record is the searched one */ if (len != ut_strlen(name) || ut_memcmp(name, field, len) != 0) { btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(NULL); goto err_exit; } ut_a(0 == ut_strcmp("SPACE", Loading Loading @@ -844,6 +841,14 @@ dict_load_table( field = rec_get_nth_field_old(rec, 5, &len); table->type = mach_read_from_4(field); if (UNIV_UNLIKELY(table->type != DICT_TABLE_ORDINARY)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: table %s: unknown table type %lu\n", name, (ulong) table->type); goto err_exit; } if (table->type == DICT_TABLE_CLUSTER_MEMBER) { ut_error; #if 0 /* clustered tables have not been implemented yet */ Loading innobase/dict/dict0mem.c +18 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,21 @@ dict_mem_table_create( return(table); } /******************************************************************** Free a table memory object. */ void dict_mem_table_free( /*================*/ dict_table_t* table) /* in: table */ { ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); mutex_free(&(table->autoinc_mutex)); mem_heap_free(table->heap); } /************************************************************************** Creates a cluster memory object. */ Loading Loading @@ -290,5 +305,8 @@ dict_mem_index_free( /*================*/ dict_index_t* index) /* in: index */ { ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); mem_heap_free(index->heap); } innobase/ibuf/ibuf0ibuf.c +3 −3 Original line number Diff line number Diff line Loading @@ -1160,9 +1160,9 @@ ibuf_dummy_index_free( dict_index_t* index) /* in: dummy index */ { dict_table_t* table = index->table; mem_heap_free(index->heap); mutex_free(&(table->autoinc_mutex)); mem_heap_free(table->heap); dict_mem_index_free(index); dict_mem_table_free(table); } /************************************************************************* Loading innobase/include/dict0dict.h +9 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,15 @@ ulint dict_col_get_clust_pos( /*===================*/ dict_col_t* col); /******************************************************************** If the given column name is reserved for InnoDB system columns, return TRUE. */ ibool dict_col_name_is_reserved( /*======================*/ /* out: TRUE if name is reserved */ const char* name); /* in: column name */ /************************************************************************ Initializes the autoinc counter. It is not an error to initialize an already initialized counter. */ Loading Loading
innobase/dict/dict0dict.c +34 −4 Original line number Diff line number Diff line Loading @@ -1249,15 +1249,13 @@ dict_table_remove_from_cache( /* Remove table from LRU list of tables */ UT_LIST_REMOVE(table_LRU, dict_sys->table_LRU, table); mutex_free(&(table->autoinc_mutex)); size = mem_heap_get_size(table->heap); ut_ad(dict_sys->size >= size); dict_sys->size -= size; mem_heap_free(table->heap); dict_mem_table_free(table); } /************************************************************************** Loading Loading @@ -1378,6 +1376,38 @@ dict_col_reposition_in_cache( HASH_INSERT(dict_col_t, hash, dict_sys->col_hash, fold, col); } /******************************************************************** If the given column name is reserved for InnoDB system columns, return TRUE. */ ibool dict_col_name_is_reserved( /*======================*/ /* out: TRUE if name is reserved */ const char* name) /* in: column name */ { /* This check reminds that if a new system column is added to the program, it should be dealt with here. */ #if DATA_N_SYS_COLS != 4 #error "DATA_N_SYS_COLS != 4" #endif static const char* reserved_names[] = { "DB_ROW_ID", "DB_TRX_ID", "DB_ROLL_PTR", "DB_MIX_ID" }; ulint i; for (i = 0; i < UT_ARR_SIZE(reserved_names); i++) { if (strcmp(name, reserved_names[i]) == 0) { return(TRUE); } } return(FALSE); } /************************************************************************** Adds an index to the dictionary cache. */ Loading Loading @@ -1551,7 +1581,7 @@ dict_index_remove_from_cache( dict_sys->size -= size; mem_heap_free(index->heap); dict_mem_index_free(index); } /*********************************************************************** Loading
innobase/dict/dict0load.c +11 −6 Original line number Diff line number Diff line Loading @@ -767,7 +767,7 @@ dict_load_table( if (!btr_pcur_is_on_user_rec(&pcur, &mtr) || rec_get_deleted_flag(rec, sys_tables->comp)) { /* Not found */ err_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); Loading @@ -779,11 +779,8 @@ dict_load_table( /* Check if the table name in record is the searched one */ if (len != ut_strlen(name) || ut_memcmp(name, field, len) != 0) { btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(NULL); goto err_exit; } ut_a(0 == ut_strcmp("SPACE", Loading Loading @@ -844,6 +841,14 @@ dict_load_table( field = rec_get_nth_field_old(rec, 5, &len); table->type = mach_read_from_4(field); if (UNIV_UNLIKELY(table->type != DICT_TABLE_ORDINARY)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: table %s: unknown table type %lu\n", name, (ulong) table->type); goto err_exit; } if (table->type == DICT_TABLE_CLUSTER_MEMBER) { ut_error; #if 0 /* clustered tables have not been implemented yet */ Loading
innobase/dict/dict0mem.c +18 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,21 @@ dict_mem_table_create( return(table); } /******************************************************************** Free a table memory object. */ void dict_mem_table_free( /*================*/ dict_table_t* table) /* in: table */ { ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); mutex_free(&(table->autoinc_mutex)); mem_heap_free(table->heap); } /************************************************************************** Creates a cluster memory object. */ Loading Loading @@ -290,5 +305,8 @@ dict_mem_index_free( /*================*/ dict_index_t* index) /* in: index */ { ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); mem_heap_free(index->heap); }
innobase/ibuf/ibuf0ibuf.c +3 −3 Original line number Diff line number Diff line Loading @@ -1160,9 +1160,9 @@ ibuf_dummy_index_free( dict_index_t* index) /* in: dummy index */ { dict_table_t* table = index->table; mem_heap_free(index->heap); mutex_free(&(table->autoinc_mutex)); mem_heap_free(table->heap); dict_mem_index_free(index); dict_mem_table_free(table); } /************************************************************************* Loading
innobase/include/dict0dict.h +9 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,15 @@ ulint dict_col_get_clust_pos( /*===================*/ dict_col_t* col); /******************************************************************** If the given column name is reserved for InnoDB system columns, return TRUE. */ ibool dict_col_name_is_reserved( /*======================*/ /* out: TRUE if name is reserved */ const char* name); /* in: column name */ /************************************************************************ Initializes the autoinc counter. It is not an error to initialize an already initialized counter. */ Loading