MDEV-37183 Scrubbing empty record breaks recovery

page_delete_rec_list_end(): Do not attempt to scrub the data of
an empty record.

The test case would reproduce a debug assertion failure in branches
where commit 358921ce32 (MDEV-26938)
is present. MariaDB Server 10.6 only supports ascending indexes,
and in those, the empty string would always be sorted first, never
last in a page.

Nevertheless, we fix the bug also in 10.6, in case it would be
reproducible in a slightly different scenario.

Reviewed by: Thirunarayanan Balathandayuthapani
This commit is contained in:
Marko Mäkelä 2025-07-11 15:20:06 +03:00
commit f73ffd1150
3 changed files with 34 additions and 2 deletions

View file

@ -977,8 +977,9 @@ page_delete_rec_list_end(
size+= s;
n_recs++;
if (scrub)
mtr->memset(block, rec2 - page, rec_offs_data_size(offsets), 0);
if (UNIV_LIKELY(!scrub));
else if (size_t size= rec_offs_data_size(offsets))
mtr->memset(block, rec2 - page, size, 0);
rec2= page_rec_get_next(rec2);
}