diff options
Diffstat (limited to 'mysql-test/suite/encryption')
33 files changed, 524 insertions, 353 deletions
diff --git a/mysql-test/suite/encryption/import/101/t0_be.ibd b/mysql-test/suite/encryption/import/101/t0_be.ibd Binary files differnew file mode 100644 index 00000000000..6272e123d62 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t0_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t0_le.ibd b/mysql-test/suite/encryption/import/101/t0_le.ibd Binary files differnew file mode 100644 index 00000000000..6272e123d62 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t0_le.ibd diff --git a/mysql-test/suite/encryption/import/101/t1_be.ibd b/mysql-test/suite/encryption/import/101/t1_be.ibd Binary files differnew file mode 100644 index 00000000000..6e537ad0f63 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t1_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t1_le.ibd b/mysql-test/suite/encryption/import/101/t1_le.ibd Binary files differnew file mode 100644 index 00000000000..50aaafaca59 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t1_le.ibd diff --git a/mysql-test/suite/encryption/import/101/t2_be.ibd b/mysql-test/suite/encryption/import/101/t2_be.ibd Binary files differnew file mode 100644 index 00000000000..0dfd4313b1a --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t2_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t2_le.ibd b/mysql-test/suite/encryption/import/101/t2_le.ibd Binary files differnew file mode 100644 index 00000000000..03abc4b29bb --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t2_le.ibd diff --git a/mysql-test/suite/encryption/import/101/t3_be.ibd b/mysql-test/suite/encryption/import/101/t3_be.ibd Binary files differnew file mode 100644 index 00000000000..b2a7b069232 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t3_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t3_le.ibd b/mysql-test/suite/encryption/import/101/t3_le.ibd Binary files differnew file mode 100644 index 00000000000..e1be27ac6b8 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t3_le.ibd diff --git a/mysql-test/suite/encryption/import/101/t4_be.ibd b/mysql-test/suite/encryption/import/101/t4_be.ibd Binary files differnew file mode 100644 index 00000000000..cc2fff77819 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t4_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t4_le.ibd b/mysql-test/suite/encryption/import/101/t4_le.ibd Binary files differnew file mode 100644 index 00000000000..cc2fff77819 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t4_le.ibd diff --git a/mysql-test/suite/encryption/import/101/t5_be.ibd b/mysql-test/suite/encryption/import/101/t5_be.ibd Binary files differnew file mode 100644 index 00000000000..effe1bde060 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t5_be.ibd diff --git a/mysql-test/suite/encryption/import/101/t5_le.ibd b/mysql-test/suite/encryption/import/101/t5_le.ibd Binary files differnew file mode 100644 index 00000000000..f08c2a45a50 --- /dev/null +++ b/mysql-test/suite/encryption/import/101/t5_le.ibd 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 4e4fd89d1ae..064987400f4 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result @@ -1,7 +1,9 @@ -call mtr.add_suppression("InnoDB: The page .*"); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* "); -call mtr.add_suppression("Plugin 'file_key_management' .*"); -call mtr.add_suppression("mysqld: File .*"); +call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); +call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t2.ibd cannot be decrypted."); +call mtr.add_suppression("mysqld: File .*keysbad3.txt' not found .*"); # Start server with keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; 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 94ed922a0ec..dbf5f24f876 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result @@ -1,5 +1,5 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1new.ibd cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*"); call mtr.add_suppression("InnoDB: Table \'\"test\".\"t1\"\' tablespace is set as discarded."); SET GLOBAL innodb_file_format = `Barracuda`; 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 227b8cc3deb..b80788d9eb1 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result @@ -1,4 +1,4 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); call mtr.add_suppression("InnoDB: Cannot open table .*"); call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*"); diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result index 15c2a410948..b9889df00e9 100644 --- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result +++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result @@ -1,5 +1,5 @@ call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t[1-3].ibd cannot be decrypted."); call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); # Restart mysqld --file-key-management-filename=keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; diff --git a/mysql-test/suite/encryption/r/innodb-corrupted.result b/mysql-test/suite/encryption/r/innodb-corrupted.result new file mode 100644 index 00000000000..be745777c04 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-corrupted.result @@ -0,0 +1,146 @@ +set global innodb_encrypt_tables='FORCE'; +select @@innodb_encrypt_tables; +@@innodb_encrypt_tables +FORCE +set global innodb_default_encryption_key_id=4; +select @@innodb_default_encryption_key_id; +@@innodb_default_encryption_key_id +1 +set global innodb_compression_algorithm=zlib; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +zlib +set global innodb_file_format = `Barracuda`; +set global innodb_file_per_table = on; +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t2 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t3 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t4 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +50 +select count(*) from t3; +count(*) +50 +select count(*) from t4; +count(*) +50 +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +# t0 expected FOUND +NOT FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +50 +select count(*) from t1; +count(*) +50 +select count(*) from t3; +count(*) +50 +select count(*) from t4; +count(*) +50 +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t0 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Start server again +select * from t1; +Got one of the listed errors +select * from t2; +Got one of the listed errors +select * from t3; +Got one of the listed errors +select * from t4; +Got one of the listed errors +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result index dd2b025553e..58cbe6db632 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result @@ -1,5 +1,4 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[1-9] page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); create table t5 ( `intcol1` int(32) DEFAULT NULL, diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result index 3f3a2afb02d..7d63f47d17e 100644 --- a/mysql-test/suite/encryption/r/innodb-force-corrupt.result +++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result @@ -1,9 +1,5 @@ -CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*"); -CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*"); -CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; diff --git a/mysql-test/suite/encryption/r/innodb-import-101.result b/mysql-test/suite/encryption/r/innodb-import-101.result new file mode 100644 index 00000000000..aabbb739510 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-import-101.result @@ -0,0 +1,76 @@ +set global innodb_file_format = 'Barracuda'; +create table t0_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb encrypted=yes; +create table t2_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes; +create table t3_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes encrypted=yes; +create table t4_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed; +create table t5_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed encrypted=yes; +create table t0_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb encrypted=yes; +create table t2_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes; +create table t3_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes encrypted=yes; +create table t4_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed; +create table t5_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed encrypted=yes; +alter table t0_be discard tablespace; +alter table t1_be discard tablespace; +alter table t2_be discard tablespace; +alter table t3_be discard tablespace; +alter table t4_be discard tablespace; +alter table t5_be discard tablespace; +alter table t0_le discard tablespace; +alter table t1_le discard tablespace; +alter table t2_le discard tablespace; +alter table t3_le discard tablespace; +alter table t4_le discard tablespace; +alter table t5_le discard tablespace; +alter table t0_be import tablespace; +alter table t1_be import tablespace; +alter table t2_be import tablespace; +alter table t3_be import tablespace; +alter table t4_be import tablespace; +alter table t5_be import tablespace; +alter table t0_le import tablespace; +alter table t1_le import tablespace; +alter table t2_le import tablespace; +alter table t3_le import tablespace; +alter table t4_le import tablespace; +alter table t5_le import tablespace; +select * from t0_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t1_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t2_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t3_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t4_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t5_be; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t0_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t1_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t2_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t3_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t4_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +select * from t5_le; +c1 b +1 AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa +drop table t0_be, t1_be, t2_be, t3_be, t4_be, t5_be; +drop table t0_le, t1_le, t2_le, t3_le, t4_le, t5_le; +set global innodb_file_format=default; diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result index 2f2cc025973..cd01f4c4004 100644 --- a/mysql-test/suite/encryption/r/innodb-missing-key.result +++ b/mysql-test/suite/encryption/r/innodb-missing-key.result @@ -1,6 +1,6 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate."); +call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem."); # Start server with keys2.txt CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19; @@ -37,9 +37,9 @@ COUNT(1) SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a; ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB SELECT COUNT(1) FROM t1 where b = 'ab'; -ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB +Got one of the listed errors SELECT COUNT(1) FROM t1; -ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB +Got one of the listed errors # Start server with keys2.txt SELECT COUNT(1) FROM t1; diff --git a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result index ec92825ac8e..4acfca801ab 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result +++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result @@ -1,184 +1,146 @@ -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encryption_threads = 4; +select @@innodb_encryption_threads; +@@innodb_encryption_threads +4 SET GLOBAL innodb_encrypt_tables = on; -set global innodb_compression_algorithm = 1; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -begin; -call innodb_insert_proc(2000); -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -2000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -2000 -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted'; -variable_value > 0 -1 -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; -variable_value >= 0 -1 -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed'; -variable_value > 0 -1 -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed'; -variable_value >= 0 -1 -SET GLOBAL innodb_encryption_threads = 4; -SET GLOBAL innodb_encrypt_tables = off; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted'; -variable_value >= 0 -1 -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; -variable_value > 0 -1 -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed'; -variable_value > 0 -1 -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed'; -variable_value >= 0 -1 -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +select @@innodb_encrypt_tables; +@@innodb_encrypt_tables +ON +set global innodb_compression_algorithm = zlib; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +zlib +set global innodb_file_format = `Barracuda`; +set global innodb_file_per_table = on; +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t2 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t3 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t4 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +50 +select count(*) from t3; +count(*) +50 +select count(*) from t4; +count(*) +50 +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +# t0 expected FOUND +NOT FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +50 +select count(*) from t1; +count(*) +50 +select count(*) from t3; +count(*) +50 +select count(*) from t4; +count(*) +50 +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t0 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Start server again +select * from t1; +Got one of the listed errors +select * from t2; +Got one of the listed errors +select * from t3; +Got one of the listed errors +select * from t4; +Got one of the listed errors +select count(*) from t5; +count(*) +50 +select count(*) from t6; +count(*) +50 +select count(*) from t7; +count(*) +50 +select count(*) from t8; +count(*) +50 +select count(*) from t9; +count(*) +50 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; 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 66546872c25..01df90c98b8 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test @@ -8,10 +8,12 @@ # table exists and encryption service is not available. # -call mtr.add_suppression("InnoDB: The page .*"); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* "); -call mtr.add_suppression("Plugin 'file_key_management' .*"); -call mtr.add_suppression("mysqld: File .*"); +call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); +call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t2.ibd cannot be decrypted."); +call mtr.add_suppression("mysqld: File .*keysbad3.txt' not found .*"); --echo --echo # Start server with keys2.txt 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 52ee442c725..c2459534f17 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test @@ -8,8 +8,8 @@ # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1new.ibd cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); # 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\"\' tablespace is set as discarded."); 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 14d88614f55..d38e962bd79 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test @@ -7,7 +7,7 @@ # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t1.ibd cannot be decrypted."); call mtr.add_suppression("InnoDB: Cannot open table .*"); call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); # Suppression for builds where file_key_management plugin is linked statically diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test index cb69f22f745..8af2363aed8 100644 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test @@ -5,7 +5,7 @@ -- source include/not_embedded.inc call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file ./test/t[1-3].ibd cannot be decrypted."); call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); --echo # Restart mysqld --file-key-management-filename=keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-corrupted.test b/mysql-test/suite/encryption/t/innodb-corrupted.test new file mode 100644 index 00000000000..10a958b2468 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-corrupted.test @@ -0,0 +1,25 @@ +# Don't test under embedded as we restart server +-- source include/not_embedded.inc +# Require InnoDB +-- source include/have_innodb.inc +-- source include/have_file_key_management_plugin.inc + +let $encrypt=`SELECT @@innodb_compression_algorithm`; +let $encrypt=`SELECT @@innodb_default_encryption_key_id`; + +set global innodb_encrypt_tables='FORCE'; +select @@innodb_encrypt_tables; +set global innodb_default_encryption_key_id=4; +select @@innodb_default_encryption_key_id; +set global innodb_compression_algorithm=zlib; +select @@innodb_compression_algorithm; + +--source include/innodb-page-compression.inc + +--disable_query_log +set global innodb_encrypt_tables=default; +set global innodb_default_encryption_key_id=default; +set global innodb_compression_algorithm=default; +--enable_query_log + + diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test index 38f36076c73..2aa4a89c8d4 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test @@ -7,8 +7,7 @@ # MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[1-9] page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); # Suppression for builds where file_key_management plugin is linked statically call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test index dd4ee51b1eb..cb6440127cc 100644 --- a/mysql-test/suite/encryption/t/innodb-force-corrupt.test +++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test @@ -7,12 +7,8 @@ # Don't test under embedded -- source include/not_embedded.inc -CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*"); -CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*"); -CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); --disable_warnings SET GLOBAL innodb_file_format = `Barracuda`; diff --git a/mysql-test/suite/encryption/t/innodb-import-101.opt b/mysql-test/suite/encryption/t/innodb-import-101.opt new file mode 100644 index 00000000000..510ebebd1af --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-import-101.opt @@ -0,0 +1,4 @@ +--plugin-load-add=$FILE_KEY_MANAGEMENT_SO +--loose-file-key-management +--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt +--file-key-management-encryption-algorithm=aes_cbc diff --git a/mysql-test/suite/encryption/t/innodb-import-101.test b/mysql-test/suite/encryption/t/innodb-import-101.test new file mode 100644 index 00000000000..999f37833c7 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-import-101.test @@ -0,0 +1,86 @@ +--source include/have_innodb.inc + +--disable_warnings +set global innodb_file_format = 'Barracuda'; +--enable_warnings + +create table t0_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb encrypted=yes; +create table t2_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes; +create table t3_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes encrypted=yes; +create table t4_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed; +create table t5_be (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed encrypted=yes; + +create table t0_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb encrypted=yes; +create table t2_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes; +create table t3_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=yes encrypted=yes; +create table t4_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed; +create table t5_le (c1 int not null auto_increment primary key, b char(200)) engine=innodb row_format=compressed encrypted=yes; + +alter table t0_be discard tablespace; +alter table t1_be discard tablespace; +alter table t2_be discard tablespace; +alter table t3_be discard tablespace; +alter table t4_be discard tablespace; +alter table t5_be discard tablespace; + +alter table t0_le discard tablespace; +alter table t1_le discard tablespace; +alter table t2_le discard tablespace; +alter table t3_le discard tablespace; +alter table t4_le discard tablespace; +alter table t5_le discard tablespace; + +-- let DATADIR = `SELECT @@datadir` + +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t0_be.ibd $DATADIR/test/t0_be.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t1_be.ibd $DATADIR/test/t1_be.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t2_be.ibd $DATADIR/test/t2_be.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t3_be.ibd $DATADIR/test/t3_be.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t4_be.ibd $DATADIR/test/t4_be.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t5_be.ibd $DATADIR/test/t5_be.ibd + +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t0_le.ibd $DATADIR/test/t0_le.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t1_le.ibd $DATADIR/test/t1_le.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t2_le.ibd $DATADIR/test/t2_le.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t3_le.ibd $DATADIR/test/t3_le.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t4_le.ibd $DATADIR/test/t4_le.ibd +-- copy_file $MYSQL_TEST_DIR/suite/encryption/import/101/t5_le.ibd $DATADIR/test/t5_le.ibd + +--disable_warnings +alter table t0_be import tablespace; +alter table t1_be import tablespace; +alter table t2_be import tablespace; +alter table t3_be import tablespace; +alter table t4_be import tablespace; +alter table t5_be import tablespace; + +alter table t0_le import tablespace; +alter table t1_le import tablespace; +alter table t2_le import tablespace; +alter table t3_le import tablespace; +alter table t4_le import tablespace; +alter table t5_le import tablespace; +--enable_warnings + +select * from t0_be; +select * from t1_be; +select * from t2_be; +select * from t3_be; +select * from t4_be; +select * from t5_be; + +select * from t0_le; +select * from t1_le; +select * from t2_le; +select * from t3_le; +select * from t4_le; +select * from t5_le; + +drop table t0_be, t1_be, t2_be, t3_be, t4_be, t5_be; +drop table t0_le, t1_le, t2_le, t3_le, t4_le, t5_le; + +--disable_warnings +set global innodb_file_format=default; +--enable_warnings diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test index 07a2b16211c..6fbf8b35882 100644 --- a/mysql-test/suite/encryption/t/innodb-missing-key.test +++ b/mysql-test/suite/encryption/t/innodb-missing-key.test @@ -7,9 +7,9 @@ # MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate."); +call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem."); --echo --echo # Start server with keys2.txt @@ -45,11 +45,11 @@ CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engin SELECT SLEEP(5); SELECT COUNT(1) FROM t3; SELECT COUNT(1) FROM t2; ---error 1296 +--error ER_GET_ERRMSG SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a; ---error 1296 +--error ER_GET_ERRMSG,ER_NO_SUCH_TABLE_IN_ENGINE SELECT COUNT(1) FROM t1 where b = 'ab'; ---error 1296 +--error ER_GET_ERRMSG,ER_NO_SUCH_TABLE_IN_ENGINE SELECT COUNT(1) FROM t1; --echo diff --git a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test index ea6bd65d605..6dd2d1fb8e5 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test +++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test @@ -1,136 +1,14 @@ -- source include/have_innodb.inc -- source include/have_example_key_management_plugin.inc +-- source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; -let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`; -let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`; ---enable_query_log - ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encryption_threads = 4; +select @@innodb_encryption_threads; SET GLOBAL innodb_encrypt_tables = on; ---enable_warnings - -# zlib -set global innodb_compression_algorithm = 1; - -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -begin; -call innodb_insert_proc(2000); -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; - -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED'; ---source include/wait_condition.inc - -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted'; -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed'; -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed'; - -SET GLOBAL innodb_encryption_threads = 4; -SET GLOBAL innodb_encrypt_tables = off; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; - -let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED'; ---source include/wait_condition.inc - -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted'; -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted'; -SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed'; -SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed'; +select @@innodb_encrypt_tables; +set global innodb_compression_algorithm = zlib; +select @@innodb_compression_algorithm; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; -EVAL SET GLOBAL innodb_encrypt_tables = $innodb_encrypt_tables_orig; -EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig; ---enable_query_log |