summaryrefslogtreecommitdiff
path: root/extra/innochecksum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extra/innochecksum.cc')
-rw-r--r--extra/innochecksum.cc40
1 files changed, 12 insertions, 28 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index a4d6c361809..de640a17765 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
@@ -42,43 +42,18 @@
/* Only parts of these files are included from the InnoDB codebase.
The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */
-typedef void fil_space_t;
-
-#include "univ.i" /* include all of this */
-#include "page0size.h"
-
-#define FLST_BASE_NODE_SIZE (4 + 2 * FIL_ADDR_SIZE)
-#define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE)
-#define FSEG_PAGE_DATA FIL_PAGE_DATA
-#define FSEG_HEADER_SIZE 10
-#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
-
-#include "ut0ut.h"
-#include "ut0byte.h"
-#include "mtr0types.h"
#include "mach0data.h"
-#include "fsp0types.h"
-#include "rem0rec.h"
+#include "page0page.h"
#include "buf0checksum.h" /* buf_calc_page_*() */
#include "buf0buf.h" /* buf_page_is_corrupted */
-#include "fil0fil.h" /* FIL_* */
-#include "page0page.h" /* PAGE_* */
#include "page0zip.h" /* page_zip_*() */
#include "trx0undo.h" /* TRX_* */
-#include "fsp0fsp.h" /* fsp_flags_get_page_size() &
- fsp_flags_get_zip_size() */
#include "ut0crc32.h" /* ut_crc32_init() */
#include "fsp0pagecompress.h" /* fil_get_compression_alg_name */
#include "fil0crypt.h" /* fil_space_verify_crypt_checksum */
#include <string.h>
-#ifdef UNIV_NONINL
-# include "fsp0fsp.ic"
-# include "mach0data.ic"
-# include "ut0rnd.ic"
-#endif
-
#ifndef PRIuMAX
#define PRIuMAX "llu"
#endif
@@ -525,7 +500,16 @@ is_page_corrupted(
normal method. */
if (is_encrypted && key_version != 0) {
is_corrupted = !fil_space_verify_crypt_checksum(buf,
- page_size, space_id, (ulint)cur_page_num);
+ page_size);
+ if (is_corrupted && log_file) {
+ fprintf(log_file,
+ "Page " ULINTPF ":%llu may be corrupted;"
+ " key_version=%u\n",
+ space_id, cur_page_num,
+ mach_read_from_4(
+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ + buf));
+ }
} else {
is_corrupted = true;
}