MDEV-25919 fixup: MSAN and Valgrind errors related to statistics

dict_table_close(): Fix a race condition around dict_stats_deinit().
This was not observed; it should have been caught by an assertion.

dict_stats_deinit(): Slightly simplify the code.

ha_innobase::info_low(): If the table is unreadable,
initialize some dummy statistics.
This commit is contained in:
Marko Mäkelä 2021-09-04 19:08:14 +03:00
commit 5ae5453291
3 changed files with 12 additions and 7 deletions

View file

@ -175,16 +175,13 @@ dict_stats_deinit(
dict_table_t* table) /*!< in/out: table */
{
ut_ad(table->stats_mutex_is_owner());
ut_ad(table->get_ref_count() == 0);
ut_a(table->get_ref_count() == 0);
#ifdef HAVE_valgrind
if (!table->stat_initialized) {
return;
}
table->stat_initialized = FALSE;
#ifdef HAVE_valgrind
MEM_UNDEFINED(&table->stat_n_rows, sizeof table->stat_n_rows);
MEM_UNDEFINED(&table->stat_clustered_index_size,
sizeof table->stat_clustered_index_size);
@ -218,4 +215,5 @@ dict_stats_deinit(
sizeof(index->stat_n_leaf_pages));
}
#endif /* HAVE_valgrind */
table->stat_initialized = FALSE;
}