summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-12-29 22:59:20 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-12-29 22:59:20 +0200
commit50c9469be821e1942a8a9c5f37132e1855c40c86 (patch)
tree2cfa8e841fe6bcd2e6d2a90e544399b7d4008ceb /extra
parent68143c8905352361c30595864a90f494d9a3d99f (diff)
downloadmariadb-git-50c9469be821e1942a8a9c5f37132e1855c40c86.tar.gz
MDEV-18105 Mariabackup fails to copy encrypted InnoDB system tablespace if LSN>4G
This is a regression caused by commit 8c43f963882a9d5ac4e4289c8dd3dbcaeb40a0ce that was part of the MDEV-12112 fixes. page_is_corrupted(): Never interpret page_no=0 as encrypted.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/fil_cur.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index b4393f7ffdd..c370d521947 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -306,9 +306,16 @@ static bool page_is_corrupted(byte *page, ulint page_no, xb_fil_cur_t *cursor, f
return false;
}
- /* Validate encrypted pages. */
- if (mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) &&
- (space->crypt_data && space->crypt_data->type!= CRYPT_SCHEME_UNENCRYPTED)) {
+ /* Validate encrypted pages. The first page is never encrypted.
+ In the system tablespace, the first page would be written with
+ FIL_PAGE_FILE_FLUSH_LSN at shutdown, and if the LSN exceeds
+ 4,294,967,295, the mach_read_from_4() below would wrongly
+ interpret the page as encrypted. We prevent that by checking
+ page_no first. */
+ if (page_no
+ && mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION)
+ && space->crypt_data
+ && space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED) {
if (!fil_space_verify_crypt_checksum(page, cursor->zip_size))
return true;