Skip to content
Permalink
Browse files
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 8c43f96.

btr_validate_index(): Avoid crash if btr_root_get() returns NULL.
  • Loading branch information
dr-m committed Apr 6, 2019
1 parent 1d0380e commit 80f2921
Showing 1 changed file with 2 additions and 7 deletions.
@@ -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;
}

0 comments on commit 80f2921

Please sign in to comment.