diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-19 16:29:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-19 16:29:36 +0300 |
commit | fcae2a6364abba5eccfe85e65b109a88a978f7cc (patch) | |
tree | 7847b1d05be2c7bec358bd87d7c3f7078d421cc1 | |
parent | 52e276247d4573de0a01fa1500485fbd980d423a (diff) | |
download | mariadb-git-fcae2a6364abba5eccfe85e65b109a88a978f7cc.tar.gz |
MDEV-20383 Use of uninitialized value in Datafile::find_space_id() for ROW_FORMAT=COMPRESSED
Datafile::find_space_id(): Fix a regression that was introduced
in c0f47a4a58424c621204dacb8016a94b66cb2bce for MDEV-12026.
Because the function buf_page_is_corrupted() now determines
the physical page size from the fsp_flags, our buffer size must
agree with the fsp_flags.
buf_page_is_corrupted(): Use the correct accessor
fil_space_t::zip_size() for convering the tablespace flags.
ROW_FORMAT=COMPRESSED files never use innodb_checksum_algorithm=full_crc32.
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 8 | ||||
-rw-r--r-- | storage/innobase/fsp/fsp0file.cc | 5 |
2 files changed, 4 insertions, 9 deletions
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); } |