summaryrefslogtreecommitdiff
path: root/extra/innochecksum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extra/innochecksum.cc')
-rw-r--r--extra/innochecksum.cc32
1 files changed, 11 insertions, 21 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 7ad71aa8159..8e88241ab95 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2014, 2017, MariaDB Corporation.
+ Copyright (c) 2014, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -68,6 +68,7 @@ typedef void fil_space_t;
#include "fsp0pagecompress.h" /* fil_get_compression_alg_name */
#include "fil0crypt.h" /* fil_space_verify_crypt_checksum */
#include "page0size.h"
+#include "fil0pagecompress.h" /* fil_verify_compression_checksum */
#include <string.h>
@@ -478,13 +479,9 @@ is_page_corrupted(
buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
/* We can't trust only a page type, thus we take account
- also fsp_flags or crypt_data on page 0 */
- if ((page_type == FIL_PAGE_PAGE_COMPRESSED && is_compressed) ||
- (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED &&
- is_compressed && is_encrypted)) {
- /* Page compressed tables do not contain post compression
- checksum. */
- return (false);
+ also fsp_flags. */
+ if (page_type == FIL_PAGE_PAGE_COMPRESSED && is_compressed) {
+ return(!fil_verify_compression_checksum(buf, space_id, cur_page_num));
}
if (page_size.is_compressed()) {
@@ -523,11 +520,13 @@ is_page_corrupted(
if (is_encrypted && key_version != 0) {
is_corrupted = !fil_space_verify_crypt_checksum(buf,
page_size.is_compressed() ? page_size.physical() : 0, NULL, cur_page_num);
- } else {
- is_corrupted = true;
- }
- if (is_corrupted) {
+ if (is_corrupted) {
+ is_corrupted = buf_page_is_corrupted(
+ true, buf, page_size.is_compressed() ? page_size.physical() : 0, NULL);
+ }
+
+ } else {
is_corrupted = buf_page_is_corrupted(
true, buf, page_size.is_compressed() ? page_size.physical() : 0, NULL);
}
@@ -1894,15 +1893,6 @@ int main(
skip_page = false;
}
- ulint cur_page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
-
- /* FIXME: Page compressed or Page compressed and encrypted
- pages do not contain checksum. */
- if (cur_page_type == FIL_PAGE_PAGE_COMPRESSED ||
- cur_page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
- skip_page = true;
- }
-
/* If no-check is enabled, skip the
checksum verification.*/
if (!no_check