MDEV-32725 innodb.import_update_stats accesses uninitialized ib_table->stat_n_rows

- InnoDB should write all zeros into a table and its indexes
statistics members when table is unreadable.
parent a2c6d61d
......@@ -4,7 +4,6 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/not_valgrind.inc # MDEV-32725 FIXME
let MYSQLD_DATADIR =`SELECT @@datadir`;
SET @old_innodb_file_per_table = @@innodb_file_per_table;
......
......@@ -530,16 +530,9 @@ dict_stats_empty_index(
}
}
/*********************************************************************//**
Write all zeros (or 1 where it makes sense) into a table and its indexes'
statistics members. The resulting stats correspond to an empty table. */
static
void
dict_stats_empty_table(
/*===================*/
dict_table_t* table, /*!< in/out: table */
void dict_stats_empty_table(
dict_table_t* table,
bool empty_defrag_stats)
/*!< in: whether to empty defrag stats */
{
mutex_enter(&dict_sys.mutex);
......
......@@ -14316,7 +14316,7 @@ ha_innobase::info_low(
DBUG_ASSERT(ib_table->get_ref_count() > 0);
if (!ib_table->is_readable()) {
ib_table->stat_initialized = true;
dict_stats_empty_table(ib_table, true);
}
if (flag & HA_STATUS_TIME) {
......
......@@ -240,4 +240,13 @@ dict_stats_report_error(dict_table_t* table, bool defragment = false)
void test_dict_stats_all();
#endif /* UNIV_ENABLE_UNIT_TEST_DICT_STATS */
/** Write all zeros (or 1 where it makes sense) into a table
and its indexes'statistics members. The resulting stats
correspond to an empty table.
@param table table stats to be emptied
@param empty_defrag_stats empty the defrag stats */
void
dict_stats_empty_table(
dict_table_t* table,
bool empty_defrag_stats);
#endif /* dict0stats_h */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment