summaryrefslogtreecommitdiff
path: root/storage/innobase/handler/ha_innodb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-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 b9f5984f3f4..2c0a1b9f972 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -5496,8 +5496,10 @@ ha_innobase::open(const char* name, int, uint)
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;