summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fc876e6f753..b837aec396b 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6261,8 +6261,10 @@ no_such_table:
innobase_copy_frm_flags_from_table_share(ib_table, table->s);
- /* No point to init any statistics if tablespace is still encrypted. */
- if (ib_table->is_readable()) {
+ /* 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)) {
+ } else if (ib_table->is_readable()) {
dict_stats_init(ib_table);
} else {
ib_table->stat_initialized = 1;