summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/buf/buf0dblwr.cc6
-rw-r--r--storage/innobase/log/log0recv.cc15
2 files changed, 12 insertions, 9 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 5b9c4563161..17185eab650 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -549,7 +549,7 @@ buf_dblwr_process()
for (recv_dblwr_t::list::iterator i = recv_dblwr.pages.begin();
i != recv_dblwr.pages.end();
++i, ++page_no_dblwr) {
- byte* page = *i;
+ byte* page = *i;
const ulint page_no = page_get_page_no(page);
if (!page_no) {
@@ -570,7 +570,7 @@ buf_dblwr_process()
const page_id_t page_id(space_id, page_no);
if (recv_sys->scanned_lsn < lsn) {
- ib::warn() << "Ignoring doublewrite copy of "
+ ib::warn() << "Ignoring a doublewrite copy of page "
<< page_id
<< " with future log sequence number "
<< lsn;
@@ -579,7 +579,7 @@ buf_dblwr_process()
fil_space_t* space = fil_space_acquire_for_io(space_id);
- if (space == NULL) {
+ if (!space) {
/* Maybe we have dropped the tablespace
and this page once belonged to it: do nothing */
continue;
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 281ac10c5e9..b170055daa4 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -4098,8 +4098,7 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id,
if (!fsp_flags_is_valid(flags, page_id.space()) &&
fsp_flags_convert_from_101(flags) == ULINT_UNDEFINED)
{
- ib::warn() << "Ignoring a doublewrite copy of page "
- << page_id
+ ib::warn() << "Ignoring a doublewrite copy of page " << page_id
<< "due to invalid flags " << ib::hex(flags);
return false;
}
@@ -4109,7 +4108,6 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id,
}
ut_ad(tmp_buf);
- ut_ad(space);
byte *tmp_frame= tmp_buf;
byte *tmp_page= tmp_buf + srv_page_size;
const uint16_t page_type= mach_read_from_2(page + FIL_PAGE_TYPE);
@@ -4136,9 +4134,14 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id,
memcpy(tmp_page, page, page_size.physical());
/* fall through */
case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
- return !page_size.is_compressed() &&
- fil_page_decompress(tmp_frame, tmp_page) == srv_page_size &&
- !buf_page_is_corrupted(true, tmp_page, page_size, space);
+ if (page_size.is_compressed())
+ return false; /* ROW_FORMAT=COMPRESSED cannot be page_compressed */
+ ulint decomp= fil_page_decompress(tmp_frame, tmp_page);
+ if (!decomp)
+ return false; /* decompression failed */
+ if (decomp == srv_page_size)
+ return false; /* the page was not compressed (invalid page type) */
+ return !buf_page_is_corrupted(true, tmp_page, page_size, space);
}
return !buf_page_is_corrupted(true, page, page_size, space);