diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-13 07:20:36 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-13 07:20:36 +0200 |
commit | 32904dc5fac36bffeacc75512f0444c8817a39ce (patch) | |
tree | ad5809c25e6d0e577d6433a67482735262328c5f /storage/xtradb | |
parent | 5257bcfc7afad9068ccb7f5f1777c03aa5bedb12 (diff) | |
parent | 7b082fb099348da664cf9b35f75eab54deba3b29 (diff) | |
download | mariadb-git-32904dc5fac36bffeacc75512f0444c8817a39ce.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/include/buf0buf.h | 4 | ||||
-rw-r--r-- | storage/xtradb/page/page0zip.cc | 37 |
2 files changed, 17 insertions, 24 deletions
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index e8a82f2e3e4..39fceeef384 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -1528,7 +1528,7 @@ buf_page_encrypt_before_write( NOTE! The definition appears here only for other modules of this directory (buf) to see it. Do not use from outside! */ -typedef struct { +struct buf_tmp_buffer_t { private: int32 reserved; /*!< true if this slot is reserved */ @@ -1558,7 +1558,7 @@ public: return !my_atomic_fas32_explicit(&reserved, true, MY_MEMORY_ORDER_RELAXED); } -} buf_tmp_buffer_t; +}; /** The common buffer control block structure for compressed and uncompressed frames */ diff --git a/storage/xtradb/page/page0zip.cc b/storage/xtradb/page/page0zip.cc index 0c7f9b6feff..d85594c5ce3 100644 --- a/storage/xtradb/page/page0zip.cc +++ b/storage/xtradb/page/page0zip.cc @@ -4927,35 +4927,28 @@ page_zip_verify_checksum( ib_uint32_t crc32 = 0 /* silence bogus warning */; ib_uint32_t innodb = 0 /* silence bogus warning */; - stored = static_cast<ib_uint32_t>(mach_read_from_4( - static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM)); + const srv_checksum_algorithm_t curr_algo = + static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm); -#if FIL_PAGE_LSN % 8 -#error "FIL_PAGE_LSN must be 64 bit aligned" -#endif + if (curr_algo == SRV_CHECKSUM_ALGORITHM_NONE) { + return true; + } - /* 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 */ - for (ulint i = 0; i < size; i++) { - if (*((const char*) data + i) != 0) { - return(FALSE); - } + bool all_zeroes = true; + for (size_t i = 0; i < size; i++) { + if (static_cast<const byte*>(data)[i] != 0) { + all_zeroes = false; + break; } - /* Empty page */ - return(TRUE); } - const srv_checksum_algorithm_t curr_algo = - static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm); - - if (curr_algo == SRV_CHECKSUM_ALGORITHM_NONE) { - return(TRUE); + if (all_zeroes) { + return true; } + stored = static_cast<ib_uint32_t>(mach_read_from_4( + static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM)); + calc = static_cast<ib_uint32_t>(page_zip_calc_checksum( data, size, curr_algo)); |