summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-21 21:12:33 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-21 21:33:29 +0530
commitfb96ac0a496f0665b3feca3cf85aeeedf4bd1e23 (patch)
tree3f2707ff050b860f2c505ed6780ad1d02f1bc369
parent64eeb250eb550138c46b3ea0b3aeb2843918de90 (diff)
downloadmariadb-git-fb96ac0a496f0665b3feca3cf85aeeedf4bd1e23.tar.gz
MDEV-25474 Background thread returns uninitialized statisticsbb-10.2-MDEV-25474
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.
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b837aec396b..c95e6646968 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6261,9 +6261,10 @@ no_such_table:
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 @@ no_such_table:
}
}
- 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);
}