diff options
Diffstat (limited to 'innobase/dict')
-rw-r--r-- | innobase/dict/dict0boot.c | 5 | ||||
-rw-r--r-- | innobase/dict/dict0crea.c | 28 | ||||
-rw-r--r-- | innobase/dict/dict0dict.c | 52 | ||||
-rw-r--r-- | innobase/dict/dict0load.c | 20 |
4 files changed, 96 insertions, 9 deletions
diff --git a/innobase/dict/dict0boot.c b/innobase/dict/dict0boot.c index 0bf2ace3324..7985dbeee66 100644 --- a/innobase/dict/dict0boot.c +++ b/innobase/dict/dict0boot.c @@ -39,8 +39,9 @@ dict_hdr_get( header = DICT_HDR + buf_page_get(DICT_HDR_SPACE, DICT_HDR_PAGE_NO, RW_X_LATCH, mtr); +#ifdef UNIV_SYNC_DEBUG buf_page_dbg_add_level(header, SYNC_DICT_HEADER); - +#endif /* UNIV_SYNC_DEBUG */ return(header); } @@ -94,7 +95,9 @@ dict_hdr_flush_row_id(void) dulint id; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ id = dict_sys->row_id; diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c index d6e817d465e..36fa0fc640e 100644 --- a/innobase/dict/dict0crea.c +++ b/innobase/dict/dict0crea.c @@ -270,9 +270,10 @@ dict_build_table_def_step( dict_table_t* cluster_table; dtuple_t* row; - UT_NOT_USED(thr); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); - +#endif /* UNIV_SYNC_DEBUG */ + table = node->table; table->id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); @@ -341,7 +342,9 @@ dict_create_sys_indexes_tuple( byte* ptr; UT_NOT_USED(trx); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(index && heap); sys_indexes = dict_sys->sys_indexes; @@ -534,8 +537,9 @@ dict_build_index_def_step( dict_index_t* index; dtuple_t* row; - UT_NOT_USED(thr); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ index = node->index; @@ -607,8 +611,10 @@ dict_create_index_tree_step( dtuple_t* search_tuple; btr_pcur_t pcur; mtr_t mtr; - + +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ UT_NOT_USED(thr); index = node->index; @@ -670,7 +676,9 @@ dict_drop_index_tree( byte* ptr; ulint len; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ptr = rec_get_nth_field(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len); @@ -791,8 +799,10 @@ dict_create_table_step( trx_t* trx; ut_ad(thr); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); - +#endif /* UNIV_SYNC_DEBUG */ + trx = thr_get_trx(thr); node = thr->run_node; @@ -899,7 +909,9 @@ dict_create_index_step( trx_t* trx; ut_ad(thr); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ trx = thr_get_trx(thr); @@ -1160,7 +1172,9 @@ dict_create_add_foreigns_to_dictionary( ulint i; char buf[10000]; - ut_ad(mutex_own(&(dict_sys->mutex))); +#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) { fprintf(stderr, @@ -1221,7 +1235,7 @@ loop: foreign->referenced_col_names[i]); } - ut_a(len < (sizeof buf) - 19) + ut_a(len < (sizeof buf) - 19); len += sprintf(buf + len,"COMMIT WORK;\nEND;\n"); graph = pars_sql(buf); diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 223b4a941cc..a9e0a5c4600 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -615,7 +615,9 @@ dict_table_get_on_id( if we are doing a rollback to handle an error in TABLE CREATE, for example, we already have the mutex! */ +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ return(dict_table_get_on_id_low(table_id, trx)); } @@ -761,7 +763,9 @@ dict_table_add_to_cache( ulint i; ut_ad(table); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->cached == FALSE); @@ -896,8 +900,10 @@ dict_table_rename_in_cache( ulint i; ut_ad(table); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); - +#endif /* UNIV_SYNC_DEBUG */ + old_size = mem_heap_get_size(table->heap); fold = ut_fold_string(new_name); @@ -1095,7 +1101,9 @@ dict_table_remove_from_cache( ulint i; ut_ad(table); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* printf("Removing table %s from dictionary cache\n", table->name); */ @@ -1166,7 +1174,9 @@ dict_table_LRU_trim(void) ut_a(0); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ table = UT_LIST_GET_LAST(dict_sys->table_LRU); @@ -1195,7 +1205,9 @@ dict_col_add_to_cache( ulint fold; ut_ad(table && col); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); fold = ut_fold_ulint_pair(ut_fold_string(table->name), @@ -1226,7 +1238,9 @@ dict_col_remove_from_cache( ulint fold; ut_ad(table && col); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); fold = ut_fold_ulint_pair(ut_fold_string(table->name), @@ -1249,7 +1263,9 @@ dict_col_reposition_in_cache( ulint fold; ut_ad(table && col); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); fold = ut_fold_ulint_pair(ut_fold_string(table->name), @@ -1283,7 +1299,9 @@ dict_index_add_to_cache( ulint i; ut_ad(index); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(index->n_def == index->n_fields); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); @@ -1409,7 +1427,9 @@ dict_index_remove_from_cache( ut_ad(table && index); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(UT_LIST_GET_LEN((index->tree)->tree_indexes) == 1); dict_tree_free(index->tree); @@ -1453,7 +1473,9 @@ dict_index_find_cols( ut_ad(table && index); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ for (i = 0; i < index->n_fields; i++) { field = dict_index_get_nth_field(index, i); @@ -1594,7 +1616,9 @@ dict_index_build_internal_clust( ut_ad(table && index); ut_ad(index->type & DICT_CLUSTERED); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* Create a new index object with certainly enough fields */ @@ -1763,7 +1787,9 @@ dict_index_build_internal_non_clust( ut_ad(table && index); ut_ad(0 == (index->type & DICT_CLUSTERED)); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* The clustered index should be the first in the list of indexes */ @@ -1882,7 +1908,9 @@ dict_foreign_remove_from_cache( /*===========================*/ dict_foreign_t* foreign) /* in, own: foreign constraint */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_a(foreign); if (foreign->referenced_table) { @@ -1911,7 +1939,9 @@ dict_foreign_find( { dict_foreign_t* foreign; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ foreign = UT_LIST_GET_FIRST(table->foreign_list); @@ -2020,7 +2050,9 @@ dict_foreign_add_to_cache( ibool added_to_referenced_list = FALSE; char* buf = dict_foreign_err_buf; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ for_table = dict_table_check_if_in_cache_low( foreign->foreign_table_name); @@ -2691,7 +2723,9 @@ dict_create_foreign_constraints_low( ulint column_name_lens[500]; char referenced_table_name[2500]; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ table = dict_table_get_low(name); @@ -3271,7 +3305,9 @@ dict_foreign_parse_drop_constraints( str = dict_strip_comments(*(trx->mysql_query_str)); ptr = str; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ loop: ptr = dict_scan_to(ptr, (char *) "DROP"); @@ -3411,7 +3447,9 @@ dict_procedure_reserve_parsed_copy( que_t* graph; proc_node_t* proc_node; +#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ mutex_enter(&(dict_sys->mutex)); @@ -3459,7 +3497,9 @@ dict_procedure_release_parsed_copy( { proc_node_t* proc_node; +#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ mutex_enter(&(dict_sys->mutex)); @@ -3936,7 +3976,9 @@ dict_foreign_print_low( { ulint i; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ printf(" FOREIGN KEY CONSTRAINT %s: %s (", foreign->id, foreign->foreign_table_name); @@ -4001,7 +4043,9 @@ dict_table_print_low( dict_foreign_t* foreign; ulint i; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ dict_update_statistics_low(table, TRUE); @@ -4054,7 +4098,9 @@ dict_col_print_low( { dtype_t* type; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ type = dict_col_get_type(col); printf("%s: ", col->name); @@ -4074,7 +4120,9 @@ dict_index_print_low( ib_longlong n_vals; ulint i; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ tree = index->tree; @@ -4120,7 +4168,9 @@ dict_field_print_low( /*=================*/ dict_field_t* field) /* in: field */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ printf(" %s", field->name); diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 48c445fa0c9..d4b6a5ff9cb 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -42,7 +42,9 @@ dict_get_first_table_name_in_db( char* table_name; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -212,7 +214,9 @@ dict_load_columns( ulint i; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); @@ -310,7 +314,9 @@ dict_load_fields( ulint i; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ UT_NOT_USED(table); @@ -422,7 +428,9 @@ dict_load_indexes( dulint id; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ if ((ut_dulint_get_high(table->id) == 0) && (ut_dulint_get_low(table->id) < DICT_HDR_FIRST_ID)) { @@ -591,7 +599,9 @@ dict_load_table( ulint err; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -744,7 +754,9 @@ dict_load_table_on_id( char* name; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ /* NOTE that the operation of this function is protected by the dictionary mutex, and therefore no deadlocks can occur @@ -829,7 +841,9 @@ dict_load_sys_table( { mem_heap_t* heap; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -860,7 +874,9 @@ dict_load_foreign_cols( ulint i; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ foreign->foreign_col_names = mem_heap_alloc(foreign->heap, foreign->n_fields * sizeof(void*)); @@ -941,7 +957,9 @@ dict_load_foreign( ulint err; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ heap2 = mem_heap_create(1000); @@ -1073,7 +1091,9 @@ dict_load_foreigns( ulint err; mtr_t mtr; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#endif /* UNIV_SYNC_DEBUG */ sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN"); |