diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-29 23:12:25 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-29 23:12:25 +0200 |
commit | cf9070a8f7dec309878e464b277db7dbb3556cf0 (patch) | |
tree | 1acfd5c49dd4e5c3cd0d0b2f66e0706367a8a53a /extra/mariabackup | |
parent | 0b73b96f9d3e6de66f2d2a4156b168187ed4d021 (diff) | |
parent | 50c9469be821e1942a8a9c5f37132e1855c40c86 (diff) | |
download | mariadb-git-cf9070a8f7dec309878e464b277db7dbb3556cf0.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'extra/mariabackup')
-rw-r--r-- | extra/mariabackup/fil_cur.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc index 44d1b788436..49e5f181d42 100644 --- a/extra/mariabackup/fil_cur.cc +++ b/extra/mariabackup/fil_cur.cc @@ -314,10 +314,16 @@ static bool page_is_corrupted(byte *page, ulint page_no, xb_fil_cur_t *cursor, 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->page_size)) return true; |