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

Cleanup: Use the alias BTR_PURGE_TREE for pessimistic delete

parent ae6ebafd
......@@ -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);
......
......@@ -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()));
......
......@@ -1696,8 +1696,7 @@ row_log_table_apply_delete_low(
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;
}
......
......@@ -216,7 +216,7 @@ row_purge_remove_clust_if_poss_low(
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:
......
......@@ -207,9 +207,8 @@ row_undo_ins_remove_clust_rec(
} 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
......
......@@ -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);
}
......
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