diff options
Diffstat (limited to 'storage/innobase/handler/i_s.cc')
-rw-r--r-- | storage/innobase/handler/i_s.cc | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 3b2207beed5..340156249fc 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -1335,12 +1335,12 @@ i_s_cmp_per_index_fill_low( RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name.str); /* Create a snapshot of the stats so we do not bump into lock - order violations with dict_sys.mutex below. */ + order violations with dict_sys.latch below. */ mysql_mutex_lock(&page_zip_stat_per_index_mutex); page_zip_stat_per_index_t snap (page_zip_stat_per_index); mysql_mutex_unlock(&page_zip_stat_per_index_mutex); - dict_sys.mutex_lock(); + dict_sys.freeze(SRW_LOCK_CALL); page_zip_stat_per_index_t::iterator iter; ulint i; @@ -1393,18 +1393,18 @@ i_s_cmp_per_index_fill_low( status = 1; break; } - /* Release and reacquire the dict mutex to allow other + /* Release and reacquire the dict_sys.latch to allow other threads to proceed. This could eventually result in the contents of INFORMATION_SCHEMA.innodb_cmp_per_index being inconsistent, but it is an acceptable compromise. */ if (i == 1000) { - dict_sys.mutex_unlock(); + dict_sys.unfreeze(); i = 0; - dict_sys.mutex_lock(); + dict_sys.freeze(SRW_LOCK_CALL); } } - dict_sys.mutex_unlock(); + dict_sys.unfreeze(); if (reset) { page_zip_reset_stat_per_index(); @@ -3974,7 +3974,7 @@ i_s_innodb_buffer_page_fill( if (page_info->page_type == I_S_PAGE_TYPE_INDEX) { bool ret = false; - dict_sys.mutex_lock(); + dict_sys.freeze(SRW_LOCK_CALL); const dict_index_t* index = dict_index_get_if_in_cache_low( @@ -3999,7 +3999,7 @@ i_s_innodb_buffer_page_fill( system_charset_info); } - dict_sys.mutex_unlock(); + dict_sys.unfreeze(); OK(ret); @@ -4478,7 +4478,7 @@ i_s_innodb_buf_page_lru_fill( if (page_info->page_type == I_S_PAGE_TYPE_INDEX) { bool ret = false; - dict_sys.mutex_lock(); + dict_sys.freeze(SRW_LOCK_CALL); const dict_index_t* index = dict_index_get_if_in_cache_low( @@ -4503,7 +4503,7 @@ i_s_innodb_buf_page_lru_fill( system_charset_info); } - dict_sys.mutex_unlock(); + dict_sys.unfreeze(); OK(ret); @@ -4856,8 +4856,8 @@ i_s_sys_tables_fill_table( DBUG_RETURN(0); } - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); for (const rec_t *rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_tables); @@ -4873,7 +4873,7 @@ i_s_sys_tables_fill_table( information from SYS_TABLES row */ err_msg = i_s_sys_tables_rec(pcur, rec, &table_rec); mtr.commit(); - dict_sys.mutex_unlock(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_tables(thd, table_rec, @@ -4889,12 +4889,12 @@ i_s_sys_tables_fill_table( } /* Get the next record */ - dict_sys.mutex_lock(); mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); } mtr.commit(); - dict_sys.mutex_unlock(); + dict_sys.unlock(); DBUG_RETURN(0); } @@ -5131,7 +5131,6 @@ i_s_sys_tables_fill_table_stats( /* Get the next record */ mtr.start(); dict_sys.lock(SRW_LOCK_CALL); - if (table_rec) { dict_sys.allow_eviction(table_rec); } @@ -5333,7 +5332,7 @@ i_s_sys_indexes_fill_table( } heap = mem_heap_create(1000); - dict_sys.mutex_lock(); + dict_sys.lock(SRW_LOCK_CALL); mtr_start(&mtr); /* Start scan the SYS_INDEXES table */ @@ -5354,8 +5353,8 @@ i_s_sys_indexes_fill_table( rec, DICT_FLD__SYS_INDEXES__SPACE, &space_id); space_id = space_id == 4 ? mach_read_from_4(field) : ULINT_UNDEFINED; - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { if (int err = i_s_dict_fill_sys_indexes( @@ -5373,13 +5372,13 @@ i_s_sys_indexes_fill_table( mem_heap_empty(heap); /* Get the next record */ - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); mem_heap_free(heap); DBUG_RETURN(0); @@ -5552,8 +5551,8 @@ i_s_sys_columns_fill_table( } heap = mem_heap_create(1000); - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_columns); @@ -5569,8 +5568,8 @@ i_s_sys_columns_fill_table( &table_id, &col_name, &nth_v_col); - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_columns(thd, table_id, col_name, @@ -5585,17 +5584,18 @@ i_s_sys_columns_fill_table( mem_heap_empty(heap); /* Get the next record */ - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); mem_heap_free(heap); DBUG_RETURN(0); } + /*******************************************************************//** Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_columns @return 0 on success */ @@ -5745,8 +5745,8 @@ i_s_sys_virtual_fill_table( DBUG_RETURN(0); } - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_virtual); @@ -5760,8 +5760,8 @@ i_s_sys_virtual_fill_table( &table_id, &pos, &base_pos); - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_virtual(thd, table_id, pos, base_pos, @@ -5773,13 +5773,13 @@ i_s_sys_virtual_fill_table( } /* Get the next record */ - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); DBUG_RETURN(0); } @@ -5931,13 +5931,13 @@ i_s_sys_fields_fill_table( } heap = mem_heap_create(1000); - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); /* will save last index id so that we know whether we move to the next index. This is used to calculate prefix length */ last_id = 0; + dict_sys.lock(SRW_LOCK_CALL); rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_fields); while (rec) { @@ -5951,8 +5951,8 @@ i_s_sys_fields_fill_table( err_msg = dict_process_sys_fields_rec(heap, rec, &field_rec, &pos, &index_id, last_id); - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_fields(thd, index_id, &field_rec, @@ -5967,13 +5967,13 @@ i_s_sys_fields_fill_table( mem_heap_empty(heap); /* Get the next record */ - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); mem_heap_free(heap); DBUG_RETURN(0); @@ -6134,8 +6134,8 @@ i_s_sys_foreign_fill_table( } heap = mem_heap_create(1000); - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_foreign); @@ -6147,8 +6147,8 @@ i_s_sys_foreign_fill_table( a SYS_FOREIGN row */ err_msg = dict_process_sys_foreign_rec(heap, rec, &foreign_rec); - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_foreign(thd, &foreign_rec, @@ -6162,13 +6162,13 @@ i_s_sys_foreign_fill_table( mem_heap_empty(heap); /* Get the next record */ - mtr_start(&mtr); - dict_sys.mutex_lock(); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); mem_heap_free(heap); DBUG_RETURN(0); @@ -6327,8 +6327,8 @@ i_s_sys_foreign_cols_fill_table( } heap = mem_heap_create(1000); - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_startscan_system(&pcur, &mtr, dict_sys.sys_foreign_cols); @@ -6343,8 +6343,8 @@ i_s_sys_foreign_cols_fill_table( err_msg = dict_process_sys_foreign_col_rec( heap, rec, &name, &for_col_name, &ref_col_name, &pos); - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); if (!err_msg) { i_s_dict_fill_sys_foreign_cols( @@ -6359,13 +6359,13 @@ i_s_sys_foreign_cols_fill_table( mem_heap_empty(heap); /* Get the next record */ - dict_sys.mutex_lock(); - mtr_start(&mtr); + mtr.start(); + dict_sys.lock(SRW_LOCK_CALL); rec = dict_getnext_system(&pcur, &mtr); } - mtr_commit(&mtr); - dict_sys.mutex_unlock(); + mtr.commit(); + dict_sys.unlock(); mem_heap_free(heap); DBUG_RETURN(0); |