summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-01-21 09:32:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-01-21 09:50:52 +0200
commitd4144c8e010b61a440d422d0f1ca5b066532d173 (patch)
treeb534b751988ef91fc01cb5aabaeaa303726a2e81 /storage
parent778192454eba32f7b1f041026b3124d3de9c61c3 (diff)
downloadmariadb-git-d4144c8e010b61a440d422d0f1ca5b066532d173.tar.gz
MDEV-17821 Assertion !page_rec_is_supremum(rec) failed in btr_pcur_store_position
MDEV-11369 (instant ADD COLUMN) introduced a regression in the case the leftmost leaf page of the clustered index is empty except for the hidden metadata record. btr_pcur_store_position(): If the only record in the leftmost leaf page is the metadata record, store the position before the first user record in the tree.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0pcur.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index 41661d226e1..d998ec70672 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2017, MariaDB Corporation.
+Copyright (c) 2016, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -141,6 +141,7 @@ btr_pcur_store_position(
if (page_rec_is_supremum_low(offs)) {
cursor->rel_pos = BTR_PCUR_AFTER_LAST_IN_TREE;
} else {
+before_first:
cursor->rel_pos = BTR_PCUR_BEFORE_FIRST_IN_TREE;
}
@@ -158,8 +159,12 @@ btr_pcur_store_position(
rec = page_rec_get_next(rec);
if (rec_is_metadata(rec, index)) {
+ ut_ad(!page_has_prev(page));
rec = page_rec_get_next(rec);
- ut_ad(!page_rec_is_supremum(rec));
+ if (page_rec_is_supremum(rec)) {
+ ut_ad(page_has_next(page));
+ goto before_first;
+ }
}
cursor->rel_pos = BTR_PCUR_BEFORE;