diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-23 18:58:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-23 18:58:59 +0300 |
commit | 25faeff92e1d30ffcc50a9472a23736b0f62d006 (patch) | |
tree | 6f20136f2ca592112cf9a1f151b2867dffd264b6 | |
parent | ee455e6f2e6c9cda921c0801210786123d9f8b95 (diff) | |
download | mariadb-git-bb-10.4-marko.tar.gz |
MDEV-23026 fixupbb-10.4-marko
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 71dc310501d..66d2ad43453 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6195,16 +6195,6 @@ 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 (bk_thread) { - } else if (ib_table->is_readable()) { - dict_stats_init(ib_table); - } else { - ib_table->stat_initialized = 1; - } - MONITOR_INC(MONITOR_TABLE_OPEN); if ((ib_table->flags2 & DICT_TF2_DISCARDED)) { @@ -6400,7 +6390,7 @@ ha_innobase::open(const char* name, int, uint) ut_ad(!m_prebuilt->table || table->versioned() == m_prebuilt->table->versioned()); - if (!bk_thread) { + if (!THDVAR(thd, background_thread)) { info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_OPEN); } @@ -14251,6 +14241,10 @@ ha_innobase::info_low( ib_table = m_prebuilt->table; DBUG_ASSERT(ib_table->get_ref_count() > 0); + if (!ib_table->is_readable()) { + ib_table->stat_initialized = true; + } + if (flag & HA_STATUS_TIME) { if (is_analyze || innobase_stats_on_metadata) { @@ -14303,6 +14297,8 @@ ha_innobase::info_low( DBUG_EXECUTE_IF("dict_sys_mutex_avoid", goto func_exit;); + dict_stats_init(ib_table); + if (flag & HA_STATUS_VARIABLE) { ulint stat_clustered_index_size; |