Skip to content

Commit f0e4f94

Browse files
committed
MDEV-15871 Crash in btr_search_build_page_hash_index()
When skipping the MDEV-11369 'default row' record, check again for an empty page.
1 parent 97e51d2 commit f0e4f94

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

storage/innobase/btr/btr0sea.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,13 @@ btr_search_build_page_hash_index(
14061406
return;
14071407
}
14081408

1409+
rec = page_rec_get_next_const(page_get_infimum_rec(page));
1410+
1411+
if (rec_is_default_row(rec, index)) {
1412+
rec = page_rec_get_next_const(rec);
1413+
if (!--n_recs) return;
1414+
}
1415+
14091416
/* Calculate and cache fold values and corresponding records into
14101417
an array for fast insertion to the hash index */
14111418

@@ -1417,12 +1424,6 @@ btr_search_build_page_hash_index(
14171424

14181425
ut_a(index->id == btr_page_get_index_id(page));
14191426

1420-
rec = page_rec_get_next_const(page_get_infimum_rec(page));
1421-
1422-
if (rec_is_default_row(rec, index)) {
1423-
rec = page_rec_get_next_const(rec);
1424-
}
1425-
14261427
offsets = rec_get_offsets(
14271428
rec, index, offsets, true,
14281429
btr_search_get_n_fields(n_fields, n_bytes),

0 commit comments

Comments
 (0)