Commit 3c3f172f authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-23308 CHECK TABLE attempts to access parent_right_page_no=FIL_NULL

mysql/mysql-server@e00ad49edc8b07317b52c9efd0810f2cbc57877a
which introduced WL#6326 to MySQL 5.7.2 added a buffer page
acquisition to CHECK TABLE code (solely for the purpose of
obeying the changed latching order), but failed to check that
a parent page actually exists. It would not necessarily exist in a
corrupted index where a parent page is missing pointer records
to child pages.
parent 6307b17a
...@@ -5028,11 +5028,13 @@ btr_validate_level( ...@@ -5028,11 +5028,13 @@ btr_validate_level(
mtr_release_block_at_savepoint( mtr_release_block_at_savepoint(
&mtr, savepoint, right_block); &mtr, savepoint, right_block);
if (parent_right_page_no != FIL_NULL) {
btr_block_get( btr_block_get(
page_id_t(index->space, page_id_t(index->space,
parent_right_page_no), parent_right_page_no),
table_page_size, table_page_size,
RW_SX_LATCH, index, &mtr); RW_SX_LATCH, index, &mtr);
}
right_block = btr_block_get( right_block = btr_block_get(
page_id_t(index->space, page_id_t(index->space,
......
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