Fix a crash in CHECK TABLE for corrupted encrypted root page

btr_root_get(): Ignore the root->page.encrypted flag.
The purpose of this flag is questionable since
commit 8c43f96388.

btr_validate_index(): Avoid crash if btr_root_get() returns NULL.
This commit is contained in:
Marko Mäkelä 2019-04-06 20:34:15 +03:00
parent 1d0380e029
commit 80f29211eb

View file

@ -272,11 +272,6 @@ btr_root_get(
And block the segment list access by others.*/
buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH,
mtr);
if (root && root->page.encrypted == true) {
root = NULL;
}
return(root ? buf_block_get_frame(root) : NULL);
}
@ -5398,8 +5393,8 @@ btr_validate_index(
page_t* root = btr_root_get(index, &mtr);
if (root == NULL && !index->is_readable()) {
err = DB_DECRYPTION_FAILED;
if (!root) {
err = DB_CORRUPTION;
mtr_commit(&mtr);
return err;
}