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

MDEV-14663 Assertion page_is_root(block->frame) failed in innobase_add_instant_try

innobase_add_instant_try(): If the leftmost leaf page does not contain
other records than the 'default row', only empty the table if there
are no successor pages.

When a table or partition which was not empty during a previous
instant ADD COLUMN became empty later, and now with this subsequent
instant ADD COLUMN we have the opportunity to convert the empty table
or partition to 'non-instant' format.

Similarly, if the table or partition is empty to begin with, that is,
it does not even contain a 'default row' record, we can use the
'non-instant' format.
parent 32170f8c
/*****************************************************************************
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation.
Copyright (c) 2013, 2018, 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
......@@ -4278,6 +4278,7 @@ innobase_add_instant_try(
buf_block_t* block = btr_pcur_get_block(&pcur);
ut_ad(page_is_leaf(block->frame));
ut_ad(!page_has_prev(block->frame));
ut_ad(!buf_block_get_page_zip(block));
const rec_t* rec = btr_pcur_get_rec(&pcur);
que_thr_t* thr = pars_complete_graph_for_exec(
......@@ -4285,7 +4286,8 @@ innobase_add_instant_try(
if (rec_is_default_row(rec, index)) {
ut_ad(page_rec_is_user_rec(rec));
if (page_rec_is_last(rec, block->frame)) {
if (!page_has_next(block->frame)
&& page_rec_is_last(rec, block->frame)) {
goto empty_table;
}
/* Extend the record with the instantly added columns. */
......
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