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);
btr_block_get( if (parent_right_page_no != FIL_NULL) {
page_id_t(index->space, btr_block_get(
parent_right_page_no), page_id_t(index->space,
table_page_size, parent_right_page_no),
RW_SX_LATCH, index, &mtr); table_page_size,
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