Commit b8426e18 authored by Marko Mäkelä's avatar Marko Mäkelä

Do not compare the 'default row' to user data

page_cur_search_with_match_bytes(): Skip the comparison of the
MIN_REC_FLAG record. Also, remove some dead code
(we asserted that the search tuple carries no MIN_REC_FLAG).
parent 50279e85
...@@ -730,6 +730,19 @@ page_cur_search_with_match_bytes( ...@@ -730,6 +730,19 @@ page_cur_search_with_match_bytes(
low_matched_fields, low_matched_bytes, low_matched_fields, low_matched_bytes,
up_matched_fields, up_matched_bytes); up_matched_fields, up_matched_bytes);
if (UNIV_UNLIKELY(rec_get_info_bits(
mid_rec,
dict_table_is_comp(index->table))
& REC_INFO_MIN_REC_FLAG)) {
ut_ad(mach_read_from_4(FIL_PAGE_PREV
+ page_align(mid_rec))
== FIL_NULL);
ut_ad(!page_rec_is_leaf(mid_rec)
|| rec_is_default_row(mid_rec, index));
cmp = 1;
goto low_rec_match;
}
offsets = rec_get_offsets( offsets = rec_get_offsets(
mid_rec, index, offsets_, is_leaf, mid_rec, index, offsets_, is_leaf,
dtuple_get_n_fields_cmp(tuple), &heap); dtuple_get_n_fields_cmp(tuple), &heap);
...@@ -763,23 +776,6 @@ page_cur_search_with_match_bytes( ...@@ -763,23 +776,6 @@ page_cur_search_with_match_bytes(
|| mode == PAGE_CUR_LE_OR_EXTENDS || mode == PAGE_CUR_LE_OR_EXTENDS
#endif /* PAGE_CUR_LE_OR_EXTENDS */ #endif /* PAGE_CUR_LE_OR_EXTENDS */
) { ) {
if (!cmp && !cur_matched_fields) {
#ifdef UNIV_DEBUG
mtr_t mtr;
mtr_start(&mtr);
/* We got a match, but cur_matched_fields is
0, it must have REC_INFO_MIN_REC_FLAG */
ulint rec_info = rec_get_info_bits(mid_rec,
rec_offs_comp(offsets));
ut_ad(rec_info & REC_INFO_MIN_REC_FLAG);
ut_ad(btr_page_get_prev(page, &mtr) == FIL_NULL);
mtr_commit(&mtr);
#endif
cur_matched_fields = dtuple_get_n_fields_cmp(tuple);
}
goto low_rec_match; goto low_rec_match;
} else { } else {
......
...@@ -806,11 +806,9 @@ cmp_dtuple_rec_with_match_bytes( ...@@ -806,11 +806,9 @@ cmp_dtuple_rec_with_match_bytes(
ut_ad(dtuple_check_typed(dtuple)); ut_ad(dtuple_check_typed(dtuple));
ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!(REC_INFO_MIN_REC_FLAG ut_ad(!(REC_INFO_MIN_REC_FLAG
& dtuple_get_info_bits(dtuple)) & dtuple_get_info_bits(dtuple)));
|| (page_is_leaf(page_align(rec)) && index->is_instant()));
ut_ad(!(REC_INFO_MIN_REC_FLAG ut_ad(!(REC_INFO_MIN_REC_FLAG
& rec_get_info_bits(rec, rec_offs_comp(offsets))) & rec_get_info_bits(rec, rec_offs_comp(offsets))));
|| (page_is_leaf(page_align(rec)) && index->is_instant()));
cur_field = *matched_fields; cur_field = *matched_fields;
cur_bytes = *matched_bytes; cur_bytes = *matched_bytes;
......
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