[Commits] 3855943fe09: MDEV-12632: Source and destination overlap in memcpy, encryption.innodb-discard-import-change fails in buildbot with valgrind

jan jan.lindstrom at mariadb.com
Fri Apr 13 09:38:02 EEST 2018


revision-id: 3855943fe09ff7d3dec45815139cb5f606b121e5 (mariadb-10.1.32-59-g3855943fe09)
parent(s): 82e968197adcd97177f992cdf76a1d0119bfc648
author: Jan Lindström
committer: Jan Lindström
timestamp: 2018-04-13 09:25:52 +0300
message:

MDEV-12632: Source and destination overlap in memcpy, encryption.innodb-discard-import-change fails in buildbot with valgrind

Use block->page.offset for checking page number.

---
 storage/innobase/row/row0import.cc | 2 +-
 storage/xtradb/row/row0import.cc   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index b7da200f10a..3e60287a2e4 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3551,7 +3551,7 @@ fil_iterate(
 			/* When tablespace is encrypted or compressed its
 			first page (i.e. page 0) is not encrypted or
 			compressed and there is no need to copy frame. */
-			if (encrypted && i != 0) {
+			if (encrypted && block->page.offset != 0) {
 				byte *local_frame = callback.get_frame(block);
 				ut_ad((writeptr + (i * size)) != local_frame);
 				memcpy((writeptr + (i * size)), local_frame, size);
diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc
index b7da200f10a..3e60287a2e4 100644
--- a/storage/xtradb/row/row0import.cc
+++ b/storage/xtradb/row/row0import.cc
@@ -3551,7 +3551,7 @@ fil_iterate(
 			/* When tablespace is encrypted or compressed its
 			first page (i.e. page 0) is not encrypted or
 			compressed and there is no need to copy frame. */
-			if (encrypted && i != 0) {
+			if (encrypted && block->page.offset != 0) {
 				byte *local_frame = callback.get_frame(block);
 				ut_ad((writeptr + (i * size)) != local_frame);
 				memcpy((writeptr + (i * size)), local_frame, size);


More information about the commits mailing list