diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 86b669209cb..d9af896e5c0 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1068,14 +1068,8 @@ buf_page_is_corrupted( size_t checksum_field2 = 0; uint32_t crc32 = 0; bool crc32_inited = false; - ulint zip_size = 0; bool crc32_chksum = false; - - zip_size = FSP_FLAGS_GET_ZIP_SSIZE(fsp_flags); - if (zip_size) { - zip_size = (UNIV_ZIP_SIZE_MIN >> 1) << zip_size; - } - + const ulint zip_size = fil_space_t::zip_size(fsp_flags); ulint page_type = mach_read_from_2(read_buf + FIL_PAGE_TYPE); /* We can trust page type if page compression is set on tablespace diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 4143e246f99..4869160b883 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -699,7 +699,8 @@ Datafile::find_space_id() /* For noncompressed pages, the page size must be equal to srv_page_size. */ - if (page_size == srv_page_size) { + if (page_size == srv_page_size + && !fil_space_t::zip_size(fsp_flags)) { noncompressed_ok = !buf_page_is_corrupted( false, page, fsp_flags); } @@ -707,7 +708,7 @@ Datafile::find_space_id() bool compressed_ok = false; if (srv_page_size <= UNIV_PAGE_SIZE_DEF - && page_size <= srv_page_size) { + && page_size == fil_space_t::zip_size(fsp_flags)) { compressed_ok = !buf_page_is_corrupted( false, page, fsp_flags); }