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

Replace the array of mutexes that used to protect
dict_index_t::stat_n_diff_key_vals[] with an array of rw locks that protects
all the stats related members in dict_table_t and all of its indexes.

Approved by:	Jimmy (rb://503)
This commit is contained in:
Vasil Dimov
2010-11-02 18:57:20 +02:00
parent addb147533
commit 49cbbf6ea4
8 changed files with 215 additions and 73 deletions

View File

@ -871,7 +871,8 @@ row_update_statistics_if_needed(
if (counter > 2000000000
|| ((ib_int64_t)counter > 16 + table->stat_n_rows / 16)) {
dict_update_statistics(table);
dict_update_statistics(table, FALSE /* update even if stats
are initialized */);
}
}
@ -2953,7 +2954,8 @@ next_rec:
dict_table_autoinc_lock(table);
dict_table_autoinc_initialize(table, 1);
dict_table_autoinc_unlock(table);
dict_update_statistics(table);
dict_update_statistics(table, FALSE /* update even if stats are
initialized */);
trx_commit_for_mysql(trx);