summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-10 20:40:26 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-10 20:40:26 +0300
commit01f45becd1b71433e240959228e35266f271bba1 (patch)
tree29656fd4363166e37141f9537e0cc5c6a081815e /storage
parent7f84e3ad754df33746c57eec46c84138701c6444 (diff)
downloadmariadb-git-01f45becd1b71433e240959228e35266f271bba1.tar.gz
MDEV-19783: Add more assertions
btr_page_get_split_rec_to_left(): Assert that in the leftmost leaf page, the metadata record exists if and only if index->is_instant(). page_validate(): Correct the wording of a message. rec_init_offsets(): Assert that whenever a record is in "instant ALTER" format, index->is_instant() must hold.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0btr.cc10
-rw-r--r--storage/innobase/page/page0page.cc5
-rw-r--r--storage/innobase/rem/rem0rec.cc3
3 files changed, 15 insertions, 3 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 6fb56acce14..18f34d382e6 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -2062,6 +2062,14 @@ rec_t* btr_page_get_split_rec_to_left(const btr_cur_t* cursor)
return NULL;
}
+ /* The metadata record must be present in the leftmost leaf page
+ of the clustered index, if and only if index->is_instant(). */
+ ut_ad(!page_is_leaf(page) || page_has_prev(page)
+ || cursor->index->is_instant()
+ == rec_is_metadata(page_rec_get_next_const(
+ page_get_infimum_rec(page)),
+ cursor->index));
+
const rec_t* infimum = page_get_infimum_rec(page);
/* If the convergence is in the middle of a page, include also
@@ -2783,7 +2791,7 @@ btr_page_split_and_insert(
ulint n_iterations = 0;
ulint n_uniq;
- if (dict_index_is_spatial(cursor->index)) {
+ if (cursor->index->is_spatial()) {
/* Split rtree page and update parent */
return(rtr_page_split_and_insert(flags, cursor, offsets, heap,
tuple, n_ext, mtr));
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index d72d13f6d09..77bdbf8bf2c 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -839,7 +839,8 @@ page_copy_rec_list_start(
const bool is_leaf = page_rec_is_leaf(rec);
/* Copy records from the original page to the new page */
- if (dict_index_is_spatial(index)) {
+ if (index->is_spatial()) {
+ ut_ad(!index->is_instant());
ulint max_to_move = page_get_n_recs(
buf_block_get_frame(block));
heap = mem_heap_create(256);
@@ -2535,7 +2536,7 @@ wrong_page_type:
& REC_INFO_MIN_REC_FLAG)) {
if (page_has_prev(page)) {
ib::error() << "REC_INFO_MIN_REC_FLAG "
- "is set in on non-left page";
+ "is set on non-left page";
ret = false;
} else if (!page_is_leaf(page)) {
/* leftmost node pointer page */
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index 11e4bff217f..8803e691498 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -600,6 +600,7 @@ rec_init_offsets(
break;
case REC_STATUS_COLUMNS_ADDED:
ut_ad(leaf);
+ ut_ad(index->is_instant());
rec_init_offsets_comp_ordinary(rec, index, offsets,
index->n_core_fields,
NULL,
@@ -741,6 +742,8 @@ resolved:
}
if (i < rec_offs_n_fields(offsets)) {
+ ut_ad(index->is_instant());
+
offs = (rec_offs_base(offsets)[i] & REC_OFFS_MASK)
| REC_OFFS_DEFAULT;