Skip to content

Commit

Permalink
MDEV-15871 Crash in btr_search_build_page_hash_index()
Browse files Browse the repository at this point in the history
When skipping the MDEV-11369 'default row' record, check again
for an empty page.
  • Loading branch information
dr-m committed Apr 15, 2018
1 parent 97e51d2 commit f0e4f94
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions storage/innobase/btr/btr0sea.cc
Expand Up @@ -1406,6 +1406,13 @@ btr_search_build_page_hash_index(
return;
}

rec = page_rec_get_next_const(page_get_infimum_rec(page));

if (rec_is_default_row(rec, index)) {
rec = page_rec_get_next_const(rec);
if (!--n_recs) return;
}

/* Calculate and cache fold values and corresponding records into
an array for fast insertion to the hash index */

Expand All @@ -1417,12 +1424,6 @@ btr_search_build_page_hash_index(

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

rec = page_rec_get_next_const(page_get_infimum_rec(page));

if (rec_is_default_row(rec, index)) {
rec = page_rec_get_next_const(rec);
}

offsets = rec_get_offsets(
rec, index, offsets, true,
btr_search_get_n_fields(n_fields, n_bytes),
Expand Down

0 comments on commit f0e4f94

Please sign in to comment.