1
0
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:
Vasil Dimov
2010-04-28 11:46:27 +03:00
parent 91702fd313
commit 2b57b0765d
4 changed files with 70 additions and 0 deletions

View File

@ -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