MDEV-25474 Background thread returns uninitialized statistics

		to mysql interpreter

InnoDB returns uninitialized statistics to mysql interpreter
when background thread is opening the table. So it leads to
assertion failure. In that case, InnoDB avoid sending
innodb statistics information to mysql interpreter.
parent 64eeb250
......@@ -6261,9 +6261,10 @@ ha_innobase::open(const char* name, int, uint)
innobase_copy_frm_flags_from_table_share(ib_table, table->s);
const bool bk_thread = THDVAR(thd, background_thread);
/* No point to init any statistics if tablespace is still encrypted
or if table is being opened by background thread */
if (THDVAR(thd, background_thread)) {
if (bk_thread) {
} else if (ib_table->is_readable()) {
dict_stats_init(ib_table);
} else {
......@@ -6515,7 +6516,10 @@ ha_innobase::open(const char* name, int, uint)
}
}
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!bk_thread) {
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
}
DBUG_RETURN(0);
}
......
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