Commit a8395853 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 3551cd32
...@@ -4574,8 +4574,7 @@ ibuf_merge_or_delete_for_page( ...@@ -4574,8 +4574,7 @@ ibuf_merge_or_delete_for_page(
} }
if (!btr_pcur_is_on_user_rec(&pcur)) { if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr)); ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto reset_bit; goto reset_bit;
} }
...@@ -4805,8 +4804,7 @@ ibuf_delete_for_discarded_space( ...@@ -4805,8 +4804,7 @@ ibuf_delete_for_discarded_space(
&pcur, &mtr); &pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) { if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr)); ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto leave_loop; 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