diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-07-18 13:10:09 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-07-18 13:10:09 +0300 |
commit | 69628551858825bebc3f1653882920e4f6555cbb (patch) | |
tree | d744f4354c81c93ac76bf6530eefde17eb093177 /storage/innobase/buf | |
parent | 26b594e4110b4f7e6f2bcfbdb4c87aef65652bc0 (diff) | |
parent | 10ebdb7f1d7a3f6aa6a91b40a9d90f482da08e58 (diff) | |
download | mariadb-git-69628551858825bebc3f1653882920e4f6555cbb.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index cb1e9818d87..806c5a6a1d4 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1113,26 +1113,26 @@ buf_page_is_corrupted( the first page of each file of the system tablespace. Ignore it for the system tablespace. */ if (!checksum_field1 && !checksum_field2) { - ulint i = 0; - do { - if (read_buf[i]) { - return true; - } - } while (++i < FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); - + /* Checksum fields can have valid value as zero. + If the page is not empty then do the checksum + calculation for the page. */ + bool all_zeroes = true; + for (size_t i = 0; i < srv_page_size; i++) { #ifndef UNIV_INNOCHECKSUM - if (!space || !space->id) { - /* Skip FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION - in the system tablespace. */ - i += 8; - } + if (i == FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + && (!space || !space->id)) { + i += 8; + } #endif - do { if (read_buf[i]) { - return true; + all_zeroes = false; + break; } - } while (++i < srv_page_size); - return false; + } + + if (all_zeroes) { + return false; + } } switch (curr_algo) { |