diff options
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a990e50138c..71dc310501d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6195,9 +6195,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 { @@ -6396,11 +6397,14 @@ ha_innobase::open(const char* name, int, uint) } } - if (table && m_prebuilt->table) { - ut_ad(table->versioned() == m_prebuilt->table->versioned()); + ut_ad(!m_prebuilt->table + || table->versioned() == m_prebuilt->table->versioned()); + + if (!bk_thread) { + info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST + | HA_STATUS_OPEN); } - info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_OPEN); DBUG_RETURN(0); } |