diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 29ceb0dabc1e7..d59e7760bbad2 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -115,8 +115,7 @@ row_purge_remove_clust_if_poss_low( retry: purge_sys.check_stop_FTS(); dict_sys.lock(SRW_LOCK_CALL); - table = dict_table_open_on_id( - table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED); + table = dict_sys.find_table(table_id); if (!table) { dict_sys.unlock(); } else if (table->n_rec_locks) { @@ -141,7 +140,6 @@ row_purge_remove_clust_if_poss_low( mtr.commit(); close_and_exit: if (table) { - dict_table_close(table, true); dict_sys.unlock(); } return success; @@ -166,7 +164,7 @@ row_purge_remove_clust_if_poss_low( if (const uint32_t space_id = dict_drop_index_tree( &node->pcur, nullptr, &mtr)) { if (table) { - if (table->release()) { + if (table->get_ref_count() == 0) { dict_sys.remove(table); } else if (table->space_id == space_id) { table->space = nullptr; @@ -181,7 +179,6 @@ row_purge_remove_clust_if_poss_low( mtr.commit(); if (table) { - dict_table_close(table, true); dict_sys.unlock(); table = nullptr; }