From 3ec8268b4a328dd755414adce5cf14ebdac5677e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Sep 2017 11:58:21 +0300 Subject: [PATCH 1/3] Follow-up to MDEV-13103: Do not add __attribute__((nonnull)) In XtraDB, buf_block_get_frame() can return NULL, and this value can be passed to buf_page_print(). Do not declare the parameter as nonnull. --- storage/xtradb/include/buf0buf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index 3c0b125b412..5e656f1c585 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -725,7 +725,7 @@ buf_print(void); UNIV_INTERN void buf_page_print(const byte* read_buf, ulint zip_size) - UNIV_COLD MY_ATTRIBUTE((nonnull)); + UNIV_COLD; /********************************************************************//** Decompress a block. From ee844f6c346ffa009dda2fcb0588ae430479c71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Sep 2017 11:59:26 +0300 Subject: [PATCH 2/3] Make the SEARCH_ABORT logic actually work The SEARCH_ABORT logic was not working as intended (tests were not being aborted). --- mysql-test/include/search_pattern_in_file++.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/search_pattern_in_file++.inc b/mysql-test/include/search_pattern_in_file++.inc index 3c5529989bb..21192b55efb 100644 --- a/mysql-test/include/search_pattern_in_file++.inc +++ b/mysql-test/include/search_pattern_in_file++.inc @@ -76,5 +76,6 @@ perl; my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND"; $ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1}; print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n"; - exit $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/; + die "$ENV{SEARCH_ABORT}\n" + if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/; EOF From d861822c4f5c05dc7a0baa470212c823fc36fe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Sep 2017 12:01:07 +0300 Subject: [PATCH 3/3] MDEV-13253 After rebuilding redo logs, InnoDB can leak data from redo log buffer recv_reset_logs(): Initialize the redo log buffer, so that no data from the old redo log can be written to the new redo log. This bug has very little impact before MariaDB 10.2. The innodb_log_encrypt option that was introduced in MariaDB 10.1 increases the impact. If the redo log used to be encrypted, and it is being resized and encryption disabled, then previously encrypted data could end up being written to the new redo log in clear text. This resulted in encryption.innodb_encrypt_log test failures in MariaDB 10.2. --- storage/innobase/log/log0recv.cc | 1 + storage/xtradb/log/log0recv.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 5180f8b19c0..b99bd582b9a 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3472,6 +3472,7 @@ recv_reset_logs( log_sys->archived_lsn = log_sys->lsn; #endif /* UNIV_LOG_ARCHIVE */ + memset(log_sys->buf, 0, log_sys->buf_size); log_block_init(log_sys->buf, log_sys->lsn); log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE); diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc index 0872d231612..2316c35be71 100644 --- a/storage/xtradb/log/log0recv.cc +++ b/storage/xtradb/log/log0recv.cc @@ -3574,6 +3574,7 @@ recv_reset_logs( log_sys->tracked_lsn = log_sys->lsn; + memset(log_sys->buf, 0, log_sys->buf_size); log_block_init(log_sys->buf, log_sys->lsn); log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE);