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

MDEV-21152 Bogus debug assertion btr_pcur_is_after_last_in_tree() in ibuf code

As noted in commit abd45cdc
a search with PAGE_CUR_GE may land on the supremum record on
a leaf page that is not the rightmost leaf page. This could occur
when all keys on the current page are smaller than the search key,
and the smallest key on the successor page is larger than the search key.

Hence, after a failed PAGE_CUR_GE search, assertions
btr_pcur_is_after_last_in_tree() are bogus
and should be replaced with btr_pcur_is_after_last_on_page().
parent a35427f3
......@@ -2434,7 +2434,7 @@ static void ibuf_read_merge_pages(const ulint* space_ids,
btr_pcur_open(ibuf.index, tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF,
&pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto done;
}
......@@ -4480,7 +4480,7 @@ ibuf_merge_or_delete_for_page(
}
if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto reset_bit;
}
......@@ -4707,7 +4707,7 @@ void ibuf_delete_for_discarded_space(ulint space)
&pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto leave_loop;
}
......
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