diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-10 18:18:30 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-16 09:36:36 +0200 |
commit | b363d9758a5185711ab800e15e409fda0b8176f8 (patch) | |
tree | 6325aad7e4a946adca6bfe758dc7968244b2f0e2 | |
parent | ae6ebafd819d48c965d2615fc78f1f950e0fbf40 (diff) | |
download | mariadb-git-b363d9758a5185711ab800e15e409fda0b8176f8.tar.gz |
Cleanup: Use the alias BTR_PURGE_TREE for pessimistic delete
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.cc | 3 | ||||
-rw-r--r-- | storage/innobase/row/row0import.cc | 3 | ||||
-rw-r--r-- | storage/innobase/row/row0log.cc | 6 | ||||
-rw-r--r-- | storage/innobase/row/row0purge.cc | 11 | ||||
-rw-r--r-- | storage/innobase/row/row0uins.cc | 11 | ||||
-rw-r--r-- | storage/innobase/row/row0umod.cc | 7 |
6 files changed, 15 insertions, 26 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 39a0d19bfa9..48cc0c69c1b 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -4011,8 +4011,7 @@ bool ibuf_delete_rec(const page_id_t page_id, btr_pcur_t* pcur, ibuf_mtr_start(mtr); mysql_mutex_lock(&ibuf_mutex); - if (!ibuf_restore_pos(page_id, search_tuple, - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, + if (!ibuf_restore_pos(page_id, search_tuple, BTR_PURGE_TREE, pcur, mtr)) { mysql_mutex_unlock(&ibuf_mutex); diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 0b4f423ce12..c6966d6e748 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1598,8 +1598,7 @@ tree structure may be changed during a pessimistic delete. */ inline dberr_t IndexPurge::purge_pessimistic_delete() noexcept { dberr_t err; - if (m_pcur.restore_position(BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - &m_mtr) != btr_pcur_t::CORRUPTED) + if (m_pcur.restore_position(BTR_PURGE_TREE, &m_mtr) != btr_pcur_t::CORRUPTED) { ut_ad(rec_get_deleted_flag(btr_pcur_get_rec(&m_pcur), m_index->table->not_redundant())); diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index cfc3d6f18f2..4021faaac5f 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -1696,8 +1696,7 @@ err_exit: mtr->start(); index->set_modified(*mtr); error = btr_pcur_open(index, entry, PAGE_CUR_LE, - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - pcur, mtr); + BTR_PURGE_TREE, pcur, mtr); if (error) { goto err_exit; } @@ -1780,8 +1779,7 @@ row_log_table_apply_delete( mtr_start(&mtr); index->set_modified(mtr); dberr_t err = btr_pcur_open(index, old_pk, PAGE_CUR_LE, - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - &pcur, &mtr); + BTR_PURGE_TREE, &pcur, &mtr); if (err != DB_SUCCESS) { goto all_done; } diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 434ea7cfd20..29ee80d7696 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -216,7 +216,7 @@ close_and_exit: btr_pcur_get_btr_cur(&node->pcur), 0, &mtr); } else { dberr_t err; - ut_ad(mode == (BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE)); + ut_ad(mode == BTR_PURGE_TREE); btr_cur_pessimistic_delete( &err, FALSE, btr_pcur_get_btr_cur(&node->pcur), 0, false, &mtr); @@ -257,8 +257,7 @@ row_purge_remove_clust_if_poss( for (ulint n_tries = 0; n_tries < BTR_CUR_RETRY_DELETE_N_TIMES; n_tries++) { - if (row_purge_remove_clust_if_poss_low( - node, BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE)) { + if (row_purge_remove_clust_if_poss_low(node, BTR_PURGE_TREE)) { return(true); } @@ -349,10 +348,8 @@ row_purge_remove_sec_if_poss_tree( mtr.start(); index->set_modified(mtr); - search_result = row_search_index_entry( - index, entry, - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - &pcur, &mtr); + search_result = row_search_index_entry(index, entry, BTR_PURGE_TREE, + &pcur, &mtr); switch (search_result) { case ROW_NOT_FOUND: diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index f730637c8d2..01304ebd474 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -207,9 +207,8 @@ retry: } else { index->set_modified(mtr); } - ut_a( - node->pcur.restore_position(BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - &mtr) == btr_pcur_t::SAME_ALL); + ut_a(node->pcur.restore_position(BTR_PURGE_TREE, &mtr) + == btr_pcur_t::SAME_ALL); btr_cur_pessimistic_delete(&err, FALSE, &node->pcur.btr_cur, 0, true, &mtr); @@ -272,7 +271,7 @@ row_undo_ins_remove_sec_low( mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED; mtr_s_lock_index(index, &mtr); } else { - ut_ad(mode == (BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE)); + ut_ad(mode == BTR_PURGE_TREE); mtr_sx_lock_index(index, &mtr); } @@ -349,9 +348,7 @@ row_undo_ins_remove_sec( /* Try then pessimistic descent to the B-tree */ retry: - err = row_undo_ins_remove_sec_low( - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, - index, entry, thr); + err = row_undo_ins_remove_sec_low(BTR_PURGE_TREE, index, entry, thr); /* The delete operation may fail if we have little file space left: TODO: easiest to crash the database diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index cca44f01920..90b3e0b2ebe 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -356,8 +356,7 @@ row_undo_mod_clust( } mtr.start(); - if (pcur->restore_position( - BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE, &mtr) != + if (pcur->restore_position(BTR_PURGE_TREE, &mtr) != btr_pcur_t::SAME_ALL) { goto mtr_commit_exit; } @@ -504,7 +503,7 @@ row_undo_mod_del_mark_or_remove_sec_low( mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED; mtr_s_lock_index(index, &mtr); } else { - ut_ad(mode == (BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE)); + ut_ad(mode == BTR_PURGE_TREE); mtr_sx_lock_index(index, &mtr); } } else { @@ -634,7 +633,7 @@ row_undo_mod_del_mark_or_remove_sec( } err = row_undo_mod_del_mark_or_remove_sec_low(node, thr, index, - entry, BTR_MODIFY_TREE | BTR_LATCH_FOR_DELETE); + entry, BTR_PURGE_TREE); return(err); } |