Commit 01f45bec authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 7f84e3ad
......@@ -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));
......
......@@ -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 @@ bool page_validate(const page_t* page, const dict_index_t* index)
& 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 */
......
......@@ -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 @@ rec_init_offsets(
}
if (i < rec_offs_n_fields(offsets)) {
ut_ad(index->is_instant());
offs = (rec_offs_base(offsets)[i] & REC_OFFS_MASK)
| REC_OFFS_DEFAULT;
......
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