Skip to content

Commit

Permalink
MDEV-11075: changing to algorithm innodb from crc32
Browse files Browse the repository at this point in the history
With innodb compressed pages formerly as crc32 changing to the
innodb checksum, optimize for speed by only calcuating the big
endian variant of crc32 after checking that the little endian
doesn't validate the page.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
  • Loading branch information
grooverdan committed Dec 9, 2016
1 parent 7ca1e2a commit 850ed6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions storage/innobase/page/page0zip.cc
Expand Up @@ -5243,13 +5243,15 @@ page_zip_verify_checksum(

const uint32_t calculated = page_zip_calc_checksum(
data, size, SRV_CHECKSUM_ALGORITHM_CRC32);
const uint32_t calculated1 = page_zip_calc_checksum(
data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true);
uint32_t calculated1;

if (stored == calculated
|| stored == calculated1
#ifdef UNIV_INNOCHECKSUM
|| ( encrypted == true && checksum == calculated)
#endif
|| stored == (calculated1 =
page_zip_calc_checksum(data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true))
#ifdef UNIV_INNOCHECKSUM
|| ( encrypted == true && checksum == calculated1)
#endif
) {
Expand Down

0 comments on commit 850ed6e

Please sign in to comment.