diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-04 10:51:38 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-04 10:51:38 +0200 |
commit | bb459416856661074c9d2560619de1db35b49bfc (patch) | |
tree | 73786481a3203c42b621a72ba23d99b81066ae5f /storage/innobase/include | |
parent | 3b9a978a3b122dbc7740e50a84914549bf7871ec (diff) | |
download | mariadb-git-bb459416856661074c9d2560619de1db35b49bfc.tar.gz |
MDEV-21205 Assertion failure in btr_sec_min_rec_mark
In commit af5947f433e98d0447960da07856eb207dd09e01
the function btr_discard_page() is invoking btr_set_min_rec_mark()
with the wrong buf_block_t* object. node_ptr is on merge_block,
not block.
btr_discard_page(): Remove the variables merge_page, page, and
always refer to block->frame or merge_block->frame instead.
Also, limit the scope of node_ptr and avoid duplicated conditions.
btr_set_min_rec_mark(): Add a template parameter, so that the
caller can specify whether the page is supposed to have a left sibling.
Otherwise, the assertion (which was introduced in the same commit)
would fail in btr_discard_page().
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/btr0btr.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index c2d7c786bc5..e23ad166534 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -523,16 +523,18 @@ btr_insert_on_non_leaf_level_func( #define btr_insert_on_non_leaf_level(f,i,l,t,m) \ btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m) -/** Set a record as the predefined minimum record. +/** Set a child page pointer record as the predefined minimum record. +@tparam has_prev whether the page is supposed to have a left sibling @param[in,out] rec leftmost record on a leftmost non-leaf page @param[in,out] block buffer pool block @param[in,out] mtr mini-transaction */ +template<bool has_prev= false> inline void btr_set_min_rec_mark(rec_t *rec, const buf_block_t &block, mtr_t *mtr) { ut_ad(block.frame == page_align(rec)); ut_ad(!page_is_leaf(block.frame)); - ut_ad(!page_has_prev(block.frame)); + ut_ad(has_prev == page_has_prev(block.frame)); rec-= page_rec_is_comp(rec) ? REC_NEW_INFO_BITS : REC_OLD_INFO_BITS; |