diff options
Diffstat (limited to 'innobase/dict/dict0dict.c')
-rw-r--r-- | innobase/dict/dict0dict.c | 52 |
1 files changed, 51 insertions, 1 deletions
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); |