summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-06 20:34:15 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-06 21:25:43 +0300
commit80f29211eb5cead5ad7520f92405f249c56f7b3a (patch)
treee77738aa1c0369bedc6975189c914be4502b722c
parent1d0380e029977033f2a971d618cc6b6cae9651dc (diff)
downloadmariadb-git-80f29211eb5cead5ad7520f92405f249c56f7b3a.tar.gz
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 8c43f963882a9d5ac4e4289c8dd3dbcaeb40a0ce. btr_validate_index(): Avoid crash if btr_root_get() returns NULL.
-rw-r--r--storage/innobase/btr/btr0btr.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 1b04160082b..53e50cc76a8 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -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;
}