diff options
Diffstat (limited to 'storage/innobase/page/page0zip.cc')
-rw-r--r-- | storage/innobase/page/page0zip.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 85ee661a746..677a2ba4f70 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4926,12 +4926,19 @@ page_zip_verify_checksum( stored = static_cast<ib_uint32_t>(mach_read_from_4( static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM)); +#if FIL_PAGE_LSN % 8 +#error "FIL_PAGE_LSN must be 64 bit aligned" +#endif + #ifndef UNIV_INNOCHECKSUM /* innochecksum doesn't compile with ut_d. Since we don't need to check for empty pages when running innochecksum, just don't include this code. */ - /* declare empty pages non-corrupted */ - if (stored == 0) { + /* Check if page is empty */ + if (stored == 0 + && *reinterpret_cast<const ib_uint64_t*>(static_cast<const char*>( + data) + + FIL_PAGE_LSN) == 0) { /* make sure that the page is really empty */ ulint i; for (i = 0; i < size; i++) { @@ -4939,7 +4946,7 @@ page_zip_verify_checksum( return(FALSE); } } - + /* Empty page */ return(TRUE); } #endif |