Skip to content

Commit 80f2921

Browse files
committed
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.
1 parent 1d0380e commit 80f2921

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

storage/innobase/btr/btr0btr.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,6 @@ btr_root_get(
272272
And block the segment list access by others.*/
273273
buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH,
274274
mtr);
275-
276-
if (root && root->page.encrypted == true) {
277-
root = NULL;
278-
}
279-
280275
return(root ? buf_block_get_frame(root) : NULL);
281276
}
282277

@@ -5398,8 +5393,8 @@ btr_validate_index(
53985393

53995394
page_t* root = btr_root_get(index, &mtr);
54005395

5401-
if (root == NULL && !index->is_readable()) {
5402-
err = DB_DECRYPTION_FAILED;
5396+
if (!root) {
5397+
err = DB_CORRUPTION;
54035398
mtr_commit(&mtr);
54045399
return err;
54055400
}

0 commit comments

Comments
 (0)