Commit f6717c4a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24258 fixup: Do not update dict_table_t::n_ref_count

row_purge_remove_clust_if_poss_low(): The table identified by
SYS_INDEXES.TABLE_ID is protected by exclusive dict_sys.latch.
There is no need to touch its reference count.
parent 329d370f
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment