diff options
Diffstat (limited to 'storage/xtradb/buf/buf0buf.cc')
-rw-r--r-- | storage/xtradb/buf/buf0buf.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index 80fe62decc3..b2c78fdf411 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -950,24 +950,24 @@ 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) { + /* Checksum fields can have valid value as zero. + If the page is not empty then do the checksum + calculation for the page. */ ulint i = 0; do { - if (read_buf[i]) { - return true; + if (i == FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + && (!space || space->id)) { + i += 8; } - } while (++i < FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); - if (!space || !space->id) { - /* Skip FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION - in the system tablespace. */ - i += 8; - } - do { - if (read_buf[i]) { - return true; + if (read_buf[i++]) { + break; } - } while (++i < srv_page_size); - return false; + } while (i < srv_page_size); + + if (i == srv_page_size) { + return false; + } } switch (curr_algo) { |