mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix Bug#53046 dict_update_statistics_low can still be run concurrently
on same table Protect dict_index_t::stat_n_diff_key_vals[] with an array of mutexes. Testing: tested all code paths under UNIV_SYNC_DEBUG for the one in dict_print() one has to enable the InnoDB table monitor: CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
This commit is contained in:
@ -7597,6 +7597,8 @@ ha_innobase::info(
|
||||
break;
|
||||
}
|
||||
|
||||
dict_index_stat_mutex_enter(index);
|
||||
|
||||
if (index->stat_n_diff_key_vals[j + 1] == 0) {
|
||||
|
||||
rec_per_key = stats.records;
|
||||
@ -7605,6 +7607,8 @@ ha_innobase::info(
|
||||
index->stat_n_diff_key_vals[j + 1]);
|
||||
}
|
||||
|
||||
dict_index_stat_mutex_exit(index);
|
||||
|
||||
/* Since MySQL seems to favor table scans
|
||||
too much over index searches, we pretend
|
||||
index selectivity is 2 times better than
|
||||
|
Reference in New Issue
Block a user