summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-12-18 16:28:19 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-12-18 16:28:19 +0200
commit560df4792696a61d2ad7a191c1ea45dff11915e9 (patch)
tree1808aeb49b7f53e34eda3020069e1eb4742be521 /extra
parent977073e3dccd32c36d59a0a9dc4d9f8e0331f7c0 (diff)
parent1b471face8110b205b9bfb460c839127bc6862dd (diff)
downloadmariadb-git-560df4792696a61d2ad7a191c1ea45dff11915e9.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/fil_cur.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index e2a47e35f6d..e8ef2df3ba1 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include "fil_cur.h"
#include "fil0crypt.h"
+#include "fil0pagecompress.h"
#include "common.h"
#include "read_filt.h"
#include "xtrabackup.h"
@@ -357,6 +358,7 @@ read_retry:
for (page = cursor->buf, i = 0; i < npages;
page += page_size, i++) {
ulint page_no = cursor->buf_page_no + i;
+ ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
if (cursor->space_id == TRX_SYS_SPACE &&
page_no >= FSP_EXTENT_SIZE &&
@@ -378,12 +380,33 @@ read_retry:
memcpy(tmp_page, page, page_size);
if (!fil_space_decrypt(space, tmp_frame,
- tmp_page, &decrypted)
+ tmp_page, &decrypted)) {
+ goto corrupted;
+ }
+
+ if (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
+ goto page_decomp;
+ }
+
+ if (buf_page_is_corrupted(true, tmp_page,
+ cursor->page_size, space)) {
+ goto corrupted;
+ }
+
+ } else if (page_type == FIL_PAGE_PAGE_COMPRESSED) {
+ memcpy(tmp_page, page, cursor->page_size.physical());
+page_decomp:
+ ulint decomp = fil_page_decompress(tmp_frame, tmp_page);
+
+ if (!decomp
+ || (decomp != srv_page_size
+ && cursor->page_size.is_compressed())
|| buf_page_is_corrupted(true, tmp_page,
cursor->page_size,
space)) {
goto corrupted;
}
+
} else if (buf_page_is_corrupted(true, page, cursor->page_size,
space)) {
corrupted: