MDEV-34357 InnoDB: Assertion failure in file ./storage/innobase/page/page0zip.cc line 4211

During InnoDB root page split, InnoDB does the following
1) First move the root records to the new page(p1)
2) Empty the root, insert the node pointer to the root page
3) Split the new page and make it as child nodes.
4) Finds the split record, allocate another new page(p2)
to the index
5) InnoDB stores the record(ret) predecessor to the supremum
record of the page (p2).
6) In page_copy_rec_list_start(), move the records from p1 to p2
upto the split record
6) Given table is a compressed row format page, InnoDB attempts to
compress the page p2 and failed (due to innodb_compression_level = 0)
7) Since the compression fails, InnoDB gets the number of preceding
records(ret_pos) of a record (ret) on the page (p2)
8) Page (p2) is a new page, ret points to infimum record.
ret_pos can be 0. InnoDB have wrong condition that ret_pos shouldn't
be 0 and returns corruption. InnoDB has similar wrong check in
page_copy_rec_list_end()
parent 4bf7c966
......@@ -811,11 +811,11 @@ page_copy_rec_list_start(
the predefined infimum record, then it would
still be the infimum, and we would have
ret_pos == 0. */
if (UNIV_UNLIKELY(!ret_pos
|| ret_pos == ULINT_UNDEFINED)) {
if (UNIV_UNLIKELY(ret_pos == ULINT_UNDEFINED)) {
*err = DB_CORRUPTION;
return nullptr;
}
*err = page_zip_reorganize(new_block, index,
page_zip_level, mtr);
switch (*err) {
......
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