summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-10 15:19:44 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-10 15:24:14 +0300
commit0f7732d1d1d898f1a9051858932c18bcc9d6f2b4 (patch)
treed6d2e5e8c667e78a2302a1097ce955b7cb632c77 /mysql-test/suite/encryption
parentc11e5cdd12a6ffbc3c95e0abff6cc86920d592fa (diff)
downloadmariadb-git-0f7732d1d1d898f1a9051858932c18bcc9d6f2b4.tar.gz
MDEV-19335 adjustment for innodb_checksum_algorithm=full_crc32
When MDEV-12026 introduced innodb_checksum_algorithm=full_crc32 in MariaDB 10.4, it accidentally added a dependency on buf_page_t::encrypted. Now that the flag has been removed, we must adjust the page-read routine. buf_page_io_complete(): When the full_crc32 page checksum matches but the tablespace ID in the page does not match after decrypting, we should declare it a decryption failure and suppress the page dump output and any attempts to re-read the page.
Diffstat (limited to 'mysql-test/suite/encryption')
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result1
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.combinations4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.combinations4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change3.combinations4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test2
10 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index 45c32317557..255dde207ed 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -6,6 +6,7 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index 78b9b7854de..543c3bc29b2 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -6,6 +6,7 @@ call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index 6c23f94eb47..e37ee8eb8cd 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -3,6 +3,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.combinations b/mysql-test/suite/encryption/t/innodb-bad-key-change.combinations
new file mode 100644
index 00000000000..be3ecd67aa8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.combinations
@@ -0,0 +1,4 @@
+[crc32]
+loose-innodb-checksum-algorithm=crc32
+[full_crc32]
+loose-innodb-checksum-algorithm=full_crc32
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index 552b9867d69..a9a32a3d6fc 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -16,6 +16,8 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
+# for innodb_checksum_algorithm=full_crc32 only
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
--echo # Start server with keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.combinations b/mysql-test/suite/encryption/t/innodb-bad-key-change2.combinations
new file mode 100644
index 00000000000..be3ecd67aa8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.combinations
@@ -0,0 +1,4 @@
+[crc32]
+loose-innodb-checksum-algorithm=crc32
+[full_crc32]
+loose-innodb-checksum-algorithm=full_crc32
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index f100c330bad..bdbf2327e5d 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -17,6 +17,8 @@ call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
+# for innodb_checksum_algorithm=full_crc32 only
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change3.combinations b/mysql-test/suite/encryption/t/innodb-bad-key-change3.combinations
new file mode 100644
index 00000000000..be3ecd67aa8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change3.combinations
@@ -0,0 +1,4 @@
+[crc32]
+loose-innodb-checksum-algorithm=crc32
+[full_crc32]
+loose-innodb-checksum-algorithm=full_crc32
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations b/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations
new file mode 100644
index 00000000000..be3ecd67aa8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations
@@ -0,0 +1,4 @@
+[crc32]
+loose-innodb-checksum-algorithm=crc32
+[full_crc32]
+loose-innodb-checksum-algorithm=full_crc32
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
index d2f75a3d6c1..b341fc81d39 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -13,6 +13,8 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+# for innodb_checksum_algorithm=full_crc32 only
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc