Skip to content

Commit a839585

Browse files
committed
MDEV-21152 Bogus debug assertion btr_pcur_is_after_last_in_tree() in ibuf code
As noted in commit abd45cd 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().
1 parent 3551cd3 commit a839585

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

storage/innobase/ibuf/ibuf0ibuf.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4574,8 +4574,7 @@ ibuf_merge_or_delete_for_page(
45744574
}
45754575

45764576
if (!btr_pcur_is_on_user_rec(&pcur)) {
4577-
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
4578-
4577+
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
45794578
goto reset_bit;
45804579
}
45814580

@@ -4805,8 +4804,7 @@ ibuf_delete_for_discarded_space(
48054804
&pcur, &mtr);
48064805

48074806
if (!btr_pcur_is_on_user_rec(&pcur)) {
4808-
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
4809-
4807+
ut_ad(btr_pcur_is_after_last_on_page(&pcur));
48104808
goto leave_loop;
48114809
}
48124810

0 commit comments

Comments
 (0)