Commit 5f5fb84a authored by Marko Mäkelä's avatar Marko Mäkelä

btr_page_empty(): Add the parameter 'flexible'

This aims to fix a bug in main.function_defaults_innodb,
but the test is now returning incorrect results
(garbage instead of NULL).
parent d77a1864
......@@ -22,3 +22,4 @@ innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
max_statement_time : cannot possibly work, depends on timing
connect-abstract : waiting for libmariadb update
function_defaults_innodb : MDEV-17520 WIP (returns garbage instead of NULL)
......@@ -1891,6 +1891,7 @@ btr_parse_page_reorganize(
@param[in,out] block page to be emptied
@param[in,out] page_zip compressed page frame, or NULL
@param[in] index index of the page
@param[in] flexible whether to invoke index->dual_format()
@param[in] level B-tree level of the page (0=leaf)
@param[in,out] mtr mini-transaction */
void
......@@ -1898,6 +1899,7 @@ btr_page_empty(
buf_block_t* block,
page_zip_des_t* page_zip,
dict_index_t* index,
bool flexible,
ulint level,
mtr_t* mtr)
{
......@@ -1926,7 +1928,7 @@ btr_page_empty(
page_create_zip(block, index, level, autoinc, mtr);
} else {
page_create(block, mtr, index->table->not_redundant()
&& (level || !index->dual_format()),
&& (level || !flexible || !index->dual_format()),
dict_index_is_spatial(index));
btr_page_set_level(page, NULL, level, mtr);
if (autoinc) {
......@@ -2172,7 +2174,8 @@ btr_root_raise_and_insert(
| REC_INFO_MIN_REC_FLAG);
/* Rebuild the root page to get free space */
btr_page_empty(root_block, root_page_zip, index, level + 1, mtr);
btr_page_empty(root_block, root_page_zip, index, false, level + 1,
mtr);
/* btr_page_empty() is supposed to zero-initialize the field. */
ut_ad(!page_get_instant(root_block->frame));
......@@ -3672,19 +3675,14 @@ btr_lift_page_up(
btr_search_drop_page_hash_index(block);
/* Make the father empty */
btr_page_empty(father_block, father_page_zip, index, page_level, mtr);
btr_page_empty(father_block, father_page_zip, index, true,
page_level, mtr);
/* btr_page_empty() is supposed to zero-initialize the field. */
ut_ad(!page_get_instant(father_block->frame));
if (page_level == 0 && index->is_instant()) {
ut_ad(!father_page_zip);
btr_set_instant(father_block, *index, mtr);
#if 0 /* FIXME: convert father_block to "instant" format if needed */
if (index->dual_format() && !page_is_comp(block_orig->frame)) {
ut_ad(page_is_leaf(block_orig->frame));
ut_ad(page_is_comp(father_block->frame));
}
#endif
}
page_level++;
......@@ -4385,7 +4383,8 @@ btr_discard_only_page_on_level(
}
}
btr_page_empty(block, buf_block_get_page_zip(block), index, 0, mtr);
btr_page_empty(block, buf_block_get_page_zip(block), index, true,
0, mtr);
ut_ad(page_is_leaf(buf_block_get_frame(block)));
/* btr_page_empty() is supposed to zero-initialize the field. */
ut_ad(!page_get_instant(block->frame));
......
......@@ -5701,7 +5701,7 @@ btr_cur_optimistic_delete_func(
lock_update_delete(block, rec);
}
btr_page_empty(block, buf_block_get_page_zip(block),
index, 0, mtr);
index, false, 0, mtr);
if (index->is_instant()) {
/* MDEV-17383: free metadata BLOBs! */
index->clear_instant_alter();
......@@ -5930,7 +5930,8 @@ btr_cur_pessimistic_delete(
if (is_metadata || !index->is_instant()
|| (first_rec != rec
&& rec_is_add_metadata(first_rec, *index))) {
btr_page_empty(block, page_zip, index, 0, mtr);
btr_page_empty(block, page_zip, index, false,
0, mtr);
if (index->is_instant()) {
/* MDEV-17383: free metadata BLOBs! */
index->clear_instant_alter();
......
......@@ -5748,7 +5748,7 @@ static bool innobase_instant_try(
}
}
/* MDEV-17383: free metadata BLOBs! */
btr_page_empty(block, NULL, index, 0, &mtr);
btr_page_empty(block, NULL, index, false, 0, &mtr);
index->clear_instant_alter();
goto func_exit;
} else if (!user_table->is_instant()) {
......
......@@ -702,6 +702,7 @@ btr_page_free(
@param[in,out] block page to be emptied
@param[in,out] page_zip compressed page frame, or NULL
@param[in] index index of the page
@param[in] flexible whether to invoke index->dual_format()
@param[in] level B-tree level of the page (0=leaf)
@param[in,out] mtr mini-transaction */
void
......@@ -709,9 +710,10 @@ btr_page_empty(
buf_block_t* block,
page_zip_des_t* page_zip,
dict_index_t* index,
bool flexible,
ulint level,
mtr_t* mtr)
MY_ATTRIBUTE((nonnull(1, 3, 5)));
MY_ATTRIBUTE((nonnull(1, 3, 6)));
/**************************************************************//**
Creates a new index page (not the root, and also not
used in page reorganization). @see btr_page_empty(). */
......
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