diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-28 14:57:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-28 14:57:28 +0300 |
commit | 4dcd00535d78e7f38affdd50d849fd9073e572ee (patch) | |
tree | ec587872c7440d3938a784016d3f851ff7b0807f | |
parent | 6e4de7441cb430e4ebec835578c7bb1c7498f57b (diff) | |
download | mariadb-git-bb-10.6-MDEV-25491.tar.gz |
fixup! e92426989c9326cbdebbb99b28c337029589b054bb-10.6-MDEV-25491
-rw-r--r-- | storage/innobase/row/row0purge.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 657aaa2e249..bea748591e1 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -108,20 +108,24 @@ row_purge_remove_clust_if_poss_low( table_id_t table_id = 0; index_id_t index_id = 0; retry: - if (!table_id) { - } else if (dict_table_t *table = dict_table_open_on_id( - table_id, false, - DICT_TABLE_OP_OPEN_ONLY_IF_CACHED)) { - if (table->n_rec_locks) { - for (dict_index_t* ind = UT_LIST_GET_FIRST( - table->indexes); ind; - ind = UT_LIST_GET_NEXT(indexes, ind)) { - if (ind->id == index_id) { - lock_discard_for_index(*ind); + if (table_id) { + MDL_ticket* mdl_ticket = nullptr; + if (dict_table_t *table = dict_table_open_on_id( + table_id, false, + DICT_TABLE_OP_OPEN_ONLY_IF_CACHED, + node->purge_thd, &mdl_ticket)) { + if (table->n_rec_locks) { + for (dict_index_t* ind = UT_LIST_GET_FIRST( + table->indexes); ind; + ind = UT_LIST_GET_NEXT(indexes, ind)) { + if (ind->id == index_id) { + lock_discard_for_index(*ind); + } } } + dict_table_close(table, false, false, + node->purge_thd, mdl_ticket); } - table->release(); } log_free_check(); mtr_t mtr; |