diff options
Diffstat (limited to 'mysql-test/suite/encryption')
41 files changed, 172 insertions, 195 deletions
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result index 38dc11e7850..cbc05dc7cc6 100644 --- a/mysql-test/suite/encryption/r/encrypt_and_grep.result +++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result @@ -1,5 +1,4 @@ SET GLOBAL innodb_file_per_table = ON; -SET GLOBAL innodb_file_format = `Barracuda`; create table t1 (a varchar(255)) engine=innodb encrypted=yes; create table t2 (a varchar(255)) engine=innodb; show warnings; @@ -16,6 +15,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry test/t1 test/t2 innodb_system @@ -34,6 +34,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry test/t2 test/t3 innodb_system @@ -58,6 +59,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry test/t1 test/t2 innodb_system diff --git a/mysql-test/suite/encryption/r/innochecksum.result b/mysql-test/suite/encryption/r/innochecksum.result index 6ea54f3d053..59804f548ae 100644 --- a/mysql-test/suite/encryption/r/innochecksum.result +++ b/mysql-test/suite/encryption/r/innochecksum.result @@ -1,4 +1,3 @@ -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; # Create and populate a tables @@ -8,12 +7,6 @@ CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1; CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4; CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; -# Write file to make mysql-test-run.pl expect the "crash", but don't -# start it until it's told to -# We give 30 seconds to do a clean shutdown because we do not want -# to redo apply the pages of t1.ibd at the time of recovery. -# We want SQL to initiate the first access to t1.ibd. -# Wait until disconnected. # Run innochecksum on t1 # Run innochecksum on t2 # Run innochecksum on t3 @@ -40,6 +33,4 @@ CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; # Run innochecksum on t3 # Run innochecksum on t6 # Restore the original tables -# Write file to make mysql-test-run.pl start up the server again -# Cleanup DROP TABLE t1, t2, t3, t4, t5, t6; 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 2e87b85489e..71ad4909899 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result @@ -1,5 +1,6 @@ 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: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found"); # Start server with keys2.txt @@ -25,15 +26,17 @@ foobar 2 # Restart server with keysbad3.txt SELECT * 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine SHOW WARNINGS; Level Code Message Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Warning 192 Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t1' doesn't exist in engine DROP TABLE t1; +Warnings: +Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. SHOW WARNINGS; Level Code Message +Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. # Start server with keys3.txt SET GLOBAL innodb_default_encryption_key_id=5; CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES; @@ -41,74 +44,63 @@ INSERT INTO t2 VALUES ('foobar',1,2); # Restart server with keys2.txt SELECT * FROM t2; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message Warning 192 Table test/t2 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine SELECT * FROM t2 where id = 1; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine SELECT * FROM t2 where b = 1; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine INSERT INTO t2 VALUES ('tmp',3,3); -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine DELETE FROM t2 where b = 3; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine DELETE FROM t2 where id = 3; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine UPDATE t2 set b = b +1; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine OPTIMIZE TABLE t2; Table Op Msg_type Msg_text -test.t2 optimize Warning Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t2 optimize Error 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 -test.t2 optimize error Corrupt +test.t2 optimize Error Table 'test.t2' doesn't exist in engine +test.t2 optimize status Operation failed SHOW WARNINGS; Level Code Message ALTER TABLE t2 ADD COLUMN d INT; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine ANALYZE TABLE t2; Table Op Msg_type Msg_text -test.t2 analyze Warning Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t2 analyze Error 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 -test.t2 analyze error Corrupt +test.t2 analyze Error Table 'test.t2' doesn't exist in engine +test.t2 analyze status Operation failed SHOW WARNINGS; Level Code Message TRUNCATE TABLE t2; -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 +ERROR 42S02: Table 'test.t2' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t2' doesn't exist in engine DROP TABLE t2; # Start server with keys2.txt 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 b1f91c0d095..087f76eda2d 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\."); @@ -6,39 +7,37 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); SELECT * 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine SHOW WARNINGS; Level Code Message Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Warning 192 Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t1' doesn't exist in engine ALTER TABLE t1 ENGINE=InnoDB; -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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine SHOW WARNINGS; Level Code Message -Warning 192 Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1296 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 +Error 1932 Table 'test.t1' doesn't exist in engine OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t1 optimize Error 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 -test.t1 optimize error Corrupt +test.t1 optimize Error Table 'test.t1' doesn't exist in engine +test.t1 optimize status Operation failed SHOW WARNINGS; Level Code Message CHECK TABLE t1; Table Op Msg_type Msg_text -test.t1 check Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t1 check Error 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 -test.t1 check error Corrupt +test.t1 check Error Table 'test.t1' doesn't exist in engine +test.t1 check status Operation failed SHOW WARNINGS; Level Code Message FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; ALTER TABLE t1 DISCARD TABLESPACE; -Warnings: -Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Warning 1812 Tablespace is missing for table 'test/t1' +ERROR 42S02: Table 'test.t1' doesn't exist in engine +DROP TABLE t1; +CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB +ENCRYPTED=YES ENCRYPTION_KEY_ID=4; +ALTER TABLE t1 DISCARD TABLESPACE; restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; Warnings: @@ -51,6 +50,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`pk`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4 RENAME TABLE t1 TO t1new; -ALTER TABLE t1new RENAME TO t2new; -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 -DROP TABLE t1new; +ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine") +ALTER TABLE t1 RENAME TO t1new; +ERROR 42S02: Table 'test.t1' doesn't exist in engine +DROP TABLE t1; 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 7f4b1fbc151..514a0aec051 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); SET GLOBAL innodb_file_per_table = ON; @@ -7,16 +8,14 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize Warning Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t1 optimize Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t1 optimize Error 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 -test.t1 optimize error Corrupt +test.t1 optimize Error Table 'test.t1' doesn't exist in engine +test.t1 optimize status Operation failed SHOW WARNINGS; Level Code Message CHECK TABLE t1; Table Op Msg_type Msg_text -test.t1 check Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table. -test.t1 check Error 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 -test.t1 check error Corrupt +test.t1 check Error Table 'test.t1' doesn't exist in engine +test.t1 check status Operation failed SHOW WARNINGS; Level Code Message DROP TABLE t1; diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result index 90668a3a395..74570c92ae0 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); create table t5 ( @@ -18,8 +19,8 @@ CREATE TABLE `t1` ( insert into t1 values (1,2,'maria','db','encryption'); alter table t1 encrypted='yes' `encryption_key_id`=1; select * 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine select * from t5; -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 +ERROR 42S02: Table 'test.t5' doesn't exist in engine drop table t1; drop table t5; diff --git a/mysql-test/suite/encryption/r/innodb-first-page-read.result b/mysql-test/suite/encryption/r/innodb-first-page-read.result index 6df80e8223d..29253885e83 100644 --- a/mysql-test/suite/encryption/r/innodb-first-page-read.result +++ b/mysql-test/suite/encryption/r/innodb-first-page-read.result @@ -1,5 +1,3 @@ -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; FLUSH STATUS; create database innodb_test; use innodb_test; diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result index 67917ca5f82..d27136bf430 100644 --- a/mysql-test/suite/encryption/r/innodb-force-corrupt.result +++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)"); 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\\."); SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; @@ -14,10 +15,10 @@ COMMIT; # Backup tables before corrupting # Corrupt tables SELECT * 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine SELECT * FROM t2; 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 * FROM t3; -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 +ERROR 42S02: Table 'test.t3' doesn't exist in engine # Restore the original tables DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result index 680db692c17..f233ed48a02 100644 --- a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result +++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result @@ -2,6 +2,8 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; NAME +SET GLOBAL innodb_file_per_table = ON; +set global innodb_compression_algorithm = 1; create database enctests; use enctests; create table t1(a int not null primary key, b char(200)) engine=innodb; diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result index 3eb48409f13..2c5401ff681 100644 --- a/mysql-test/suite/encryption/r/innodb-missing-key.result +++ b/mysql-test/suite/encryption/r/innodb-missing-key.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)"); 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\\."); # 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; @@ -32,11 +33,11 @@ SELECT COUNT(1) FROM t2; COUNT(1) 2048 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine 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 +ERROR 42S02: Table 'test.t1' doesn't exist in engine # Start server with keys2.txt SELECT COUNT(1) FROM t1; diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result index ee803261b90..f600b96f987 100644 --- a/mysql-test/suite/encryption/r/innodb-redo-badkey.result +++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result @@ -7,7 +7,6 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted"); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed"); # Restart mysqld --file-key-management-filename=keys2.txt # Wait max 10 min for key encryption threads to encrypt all spaces -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4; create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed; diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result index dcbe1f5a395..530d228cc85 100644 --- a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result +++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result @@ -4,12 +4,8 @@ call mtr.add_suppression("Plugin 'file_key_management' .*"); call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available"); call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -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=[0-9]+, page number=[0-9]+\] in file test/t4 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=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-4] cannot be decrypted"); # Restart mysqld --file-key-management-filename=keys2.txt -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20; create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed; diff --git a/mysql-test/suite/encryption/r/innodb-spatial-index.result b/mysql-test/suite/encryption/r/innodb-spatial-index.result index d8f76988f9e..e8e133c61a1 100644 --- a/mysql-test/suite/encryption/r/innodb-spatial-index.result +++ b/mysql-test/suite/encryption/r/innodb-spatial-index.result @@ -38,6 +38,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry test/t1 test/t2 innodb_system diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result index e4ece7bc4ed..8b58ff593de 100644 --- a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result +++ b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result @@ -49,6 +49,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err +# same, but with current-version header +SELECT * FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS +FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err +FOUND 2 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err # --innodb-force-recovery=6 (skip the entire redo log) SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' @@ -104,21 +111,27 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS -FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err -FOUND 1 /Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1/ in mysqld.1.err +FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err # Empty 10.3 redo log SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); COUNT(*) 1 -FOUND 1 /InnoDB: Downgrading redo log:/ in mysqld.1.err +FOUND 1 /InnoDB: .* started; log sequence number 121397[09]/ in mysqld.1.err +# Empty 10.2 redo log +SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +COUNT(*) +1 +FOUND 2 /InnoDB: Upgrading redo log:/ in mysqld.1.err # Minimal MariaDB 10.1.21 encrypted redo log SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); 1 1 -FOUND 1 /InnoDB: Encrypting redo log/ in mysqld.1.err +FOUND 2 /InnoDB: Encrypting redo log/ in mysqld.1.err ib_buffer_pool ib_logfile0 ib_logfile1 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 359f285901c..fd2f03a5d18 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result +++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result @@ -1,3 +1,4 @@ +SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encrypt_tables = on; set global innodb_compression_algorithm = 1; diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result index 72f2632ba26..ee3774bcee0 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption.result +++ b/mysql-test/suite/encryption/r/innodb_encryption.result @@ -14,6 +14,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry innodb_system # Success! # Now turn off encryption and wait for threads to decrypt everything @@ -23,6 +24,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry innodb_system SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; NAME @@ -37,6 +39,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry innodb_system SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; NAME @@ -50,6 +53,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry innodb_system # Success! # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 @@ -64,6 +68,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ NAME mysql/innodb_table_stats mysql/innodb_index_stats +mysql/transaction_registry innodb_system SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; NAME diff --git a/mysql-test/suite/encryption/r/innodb_lotoftables.result b/mysql-test/suite/encryption/r/innodb_lotoftables.result index da07a52f8c3..9dadf13f039 100644 --- a/mysql-test/suite/encryption/r/innodb_lotoftables.result +++ b/mysql-test/suite/encryption/r/innodb_lotoftables.result @@ -10,13 +10,13 @@ create database innodb_encrypted_1; use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 set autocommit=0; set autocommit=1; commit work; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 # should be empty SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE NAME LIKE 'innodb_encrypted%'; NAME @@ -24,13 +24,13 @@ create database innodb_encrypted_2; use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 set autocommit=0; commit work; set autocommit=1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 # should contain 100 tables SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME; NAME @@ -141,13 +141,13 @@ create database innodb_encrypted_3; use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 set autocommit=0; commit work; set autocommit=1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 # should contain 100 tables SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME; NAME @@ -357,7 +357,7 @@ innodb_encrypted_3/t_99 use test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME; NAME innodb_encrypted_2/t_1 @@ -770,53 +770,53 @@ innodb_encrypted_3/t_98 innodb_encrypted_3/t_99 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 4 # Success! # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 # Restart Success! show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 304 SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME; NAME innodb_encrypted_3/t_1 diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result index f75268f3290..779eb5917cd 100644 --- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result +++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result @@ -40,7 +40,6 @@ NOT FOUND /author/ in t5.ibd NOT FOUND /mangled/ in t6.ibd # t7 ... on expecting NOT FOUND NOT FOUND /mysql/ in t7.ibd -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; ALTER TABLE t1 ADD COLUMN b int default 2; ALTER TABLE t2 ADD COLUMN b int default 2; diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test index f7916843b89..9f26f0a5b24 100644 --- a/mysql-test/suite/encryption/t/encrypt_and_grep.test +++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test @@ -14,10 +14,7 @@ --let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd --let SEARCH_RANGE = 10000000 ---disable_warnings SET GLOBAL innodb_file_per_table = ON; -SET GLOBAL innodb_file_format = `Barracuda`; ---enable_warnings create table t1 (a varchar(255)) engine=innodb encrypted=yes; create table t2 (a varchar(255)) engine=innodb; diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test index f1c1b65d418..f57b8d265bb 100644 --- a/mysql-test/suite/encryption/t/innochecksum.test +++ b/mysql-test/suite/encryption/t/innochecksum.test @@ -14,12 +14,9 @@ if (!$INNOCHECKSUM) { --die Need innochecksum binary } ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; # zlib set global innodb_compression_algorithm = 1; ---enable_warnings --echo # Create and populate a tables CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; @@ -56,17 +53,7 @@ let t6_IBD = $MYSQLD_DATADIR/test/t6.ibd; let INNODB_PAGE_SIZE=`select @@innodb_page_size`; let MYSQLD_DATADIR=`select @@datadir`; ---echo # Write file to make mysql-test-run.pl expect the "crash", but don't ---echo # start it until it's told to ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect - ---echo # We give 30 seconds to do a clean shutdown because we do not want ---echo # to redo apply the pages of t1.ibd at the time of recovery. ---echo # We want SQL to initiate the first access to t1.ibd. -shutdown_server 30; - ---echo # Wait until disconnected. ---source include/wait_until_disconnected.inc +--source include/shutdown_mysqld.inc --echo # Run innochecksum on t1 -- disable_result_log @@ -276,10 +263,5 @@ EOF --move_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd --move_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd ---echo # Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc - ---echo # Cleanup +--source include/start_mysqld.inc DROP TABLE t1, t2, t3, t4, t5, t6; diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change.opt new file mode 100644 index 00000000000..d3f298d3335 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.opt @@ -0,0 +1,2 @@ +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown 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 04c50e6f327..8a431cd93ca 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test @@ -10,6 +10,7 @@ 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: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found"); @@ -36,7 +37,7 @@ SELECT * FROM t1; -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt -- source include/restart_mysqld.inc ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t1; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; @@ -66,45 +67,45 @@ INSERT INTO t2 VALUES ('foobar',1,2); -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- source include/restart_mysqld.inc ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2 where id = 1; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2 where b = 1; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE INSERT INTO t2 VALUES ('tmp',3,3); --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE DELETE FROM t2 where b = 3; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE DELETE FROM t2 where id = 3; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE UPDATE t2 set b = b +1; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; OPTIMIZE TABLE t2; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE ALTER TABLE t2 ADD COLUMN d INT; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ANALYZE TABLE t2; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE TRUNCATE TABLE t2; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt new file mode 100644 index 00000000000..d3f298d3335 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt @@ -0,0 +1,2 @@ +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown 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 3c9e10efc90..8c1a8277a30 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test @@ -8,6 +8,7 @@ # 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: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.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"); @@ -25,11 +26,11 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); --let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt --source include/restart_mysqld.inc ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t1; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE ALTER TABLE t1 ENGINE=InnoDB; --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / SHOW WARNINGS; @@ -56,8 +57,13 @@ UNLOCK TABLES; --let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt --source include/restart_mysqld.inc -# Discard should pass even with incorrect keys ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / +--error ER_NO_SUCH_TABLE_IN_ENGINE +ALTER TABLE t1 DISCARD TABLESPACE; +# Drop table will succeed. +DROP TABLE t1; + +CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB +ENCRYPTED=YES ENCRYPTION_KEY_ID=4; ALTER TABLE t1 DISCARD TABLESPACE; perl; @@ -66,7 +72,6 @@ ib_discard_tablespaces("test", "t1"); ib_restore_tablespaces("test", "t1"); EOF - --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 @@ -76,13 +81,10 @@ SHOW CREATE TABLE t1; --let $restart_parameters= --innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt --source include/restart_mysqld.inc -# Rename table should pass even with incorrect keys +--error ER_ERROR_ON_RENAME RENAME TABLE t1 TO t1new; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / - -# Alter table rename is not allowed with incorrect keys ---error ER_GET_ERRMSG -ALTER TABLE t1new RENAME TO t2new; +--error ER_NO_SUCH_TABLE_IN_ENGINE +ALTER TABLE t1 RENAME TO t1new; # Drop should pass even with incorrect keys --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -DROP TABLE t1new; +DROP TABLE t1; diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt index 6426bac41a0..d20d3b60913 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt @@ -1,4 +1,6 @@ --loose-innodb-buffer-pool-stats --loose-innodb-buffer-page --loose-innodb-buffer-page-lru ---innodb-defragment=1
\ No newline at end of file +--innodb-defragment=1 +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown 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 a2305aa968b..30d417cfe93 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test @@ -7,6 +7,7 @@ # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # +call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][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"); diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations index e096b023b52..df4560f06e5 100644 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations @@ -1,12 +1,4 @@ [crc32] -loose-innodb-tablespaces-encryption -loose-innodb-encrypt-tables=on -loose-innodb-encryption-threads=4 -max_allowed_packet=64K loose-innodb-checksum-algorithm=crc32 [none] -loose-innodb-tablespaces-encryption -loose-innodb-encrypt-tables=on -loose-innodb-encryption-threads=4 -max_allowed_packet=64K loose-innodb-checksum-algorithm=none diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.opt b/mysql-test/suite/encryption/t/innodb-compressed-blob.opt new file mode 100644 index 00000000000..061212b3034 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.opt @@ -0,0 +1,6 @@ +--max-allowed-packet=64K +--innodb-tablespaces-encryption +--innodb-encrypt-tables=on +--innodb-encryption-threads=4 +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.opt b/mysql-test/suite/encryption/t/innodb-encryption-disable.opt new file mode 100644 index 00000000000..d3f298d3335 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.opt @@ -0,0 +1,2 @@ +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test index 8c72cf6a3b2..0514ce70fb6 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test @@ -7,6 +7,7 @@ # MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table # +call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)"); call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\."); # Suppression for builds where file_key_management plugin is linked statically @@ -39,9 +40,9 @@ alter table t1 encrypted='yes' `encryption_key_id`=1; --let $restart_parameters=--innodb-encrypt-tables=OFF --source include/restart_mysqld.inc ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE select * from t1; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE select * from t5; --let $restart_parameters=--innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.test b/mysql-test/suite/encryption/t/innodb-first-page-read.test index d661e4565d2..c86e16c52b8 100644 --- a/mysql-test/suite/encryption/t/innodb-first-page-read.test +++ b/mysql-test/suite/encryption/t/innodb-first-page-read.test @@ -2,11 +2,6 @@ -- source include/have_file_key_management_plugin.inc -- source include/not_embedded.inc ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; ---enable_warnings - FLUSH STATUS; create database innodb_test; diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.opt b/mysql-test/suite/encryption/t/innodb-force-corrupt.opt new file mode 100644 index 00000000000..d3f298d3335 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.opt @@ -0,0 +1,2 @@ +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test index 4d3bfc2d1e9..c23959801ca 100644 --- a/mysql-test/suite/encryption/t/innodb-force-corrupt.test +++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test @@ -7,6 +7,7 @@ # Don't test under embedded -- source include/not_embedded.inc +call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)"); 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\\."); SET GLOBAL innodb_file_per_table = ON; @@ -65,11 +66,11 @@ EOF --source include/start_mysqld.inc ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t1; --error ER_GET_ERRMSG SELECT * FROM t2; ---error ER_GET_ERRMSG +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t3; --source include/shutdown_mysqld.inc diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test index 574e0c3becc..3167cee4b4b 100644 --- a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test +++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test @@ -6,15 +6,10 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; ---disable_query_log ---disable_warnings let $encryption = `SELECT @@innodb_encrypt_tables`; -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; # zlib set global innodb_compression_algorithm = 1; ---enable_warnings ---enable_query_log create database enctests; use enctests; diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.opt b/mysql-test/suite/encryption/t/innodb-missing-key.opt index 02691695cbd..5e144bc2d3c 100644 --- a/mysql-test/suite/encryption/t/innodb-missing-key.opt +++ b/mysql-test/suite/encryption/t/innodb-missing-key.opt @@ -2,4 +2,5 @@ --innodb-encryption-rotate-key-age=15 --innodb-encryption-threads=4 --innodb-tablespaces-encryption - +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test index 8091d23cf1c..2a56581601a 100644 --- a/mysql-test/suite/encryption/t/innodb-missing-key.test +++ b/mysql-test/suite/encryption/t/innodb-missing-key.test @@ -7,6 +7,7 @@ # MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing # +call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)"); 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\\."); --echo # Start server with keys2.txt @@ -42,11 +43,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_NO_SUCH_TABLE_IN_ENGINE SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a; ---error 1296 +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT COUNT(1) FROM t1 where b = 'ab'; ---error 1296 +--error ER_NO_SUCH_TABLE_IN_ENGINE SELECT COUNT(1) FROM t1; --echo diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt index 343128e8803..2de0bdb3241 100644 --- a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt +++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt @@ -3,3 +3,5 @@ --innodb-tablespaces-encryption --innodb-encryption-threads=2 --innodb-default-encryption-key-id=4 +--innodb-purge-rseg-truncate-frequency=1 +--skip-innodb-fast-shutdown diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test index be8555584bb..bc75ca190e7 100644 --- a/mysql-test/suite/encryption/t/innodb-redo-badkey.test +++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test @@ -20,10 +20,7 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile --let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 --source include/wait_condition.inc ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; ---enable_warnings create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4; create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed; diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test index e55e2ade153..5c344f5beb1 100644 --- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test +++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test @@ -9,19 +9,13 @@ call mtr.add_suppression("Plugin 'file_key_management' .*"); call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available"); call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -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=[0-9]+, page number=[0-9]+\] in file test/t4 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=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-4] cannot be decrypted"); --echo # Restart mysqld --file-key-management-filename=keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- source include/restart_mysqld.inc ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; ---enable_warnings create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20; create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed; 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 113b5001f0f..999ff4ff45a 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test +++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test @@ -5,6 +5,7 @@ let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`; let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`; +SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encrypt_tables = on; diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test index b222e1882d5..9f61bf118aa 100644 --- a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test +++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test @@ -75,10 +75,7 @@ set autocommit=1; -- source include/start_mysqld.inc ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; ---enable_warnings ALTER TABLE t1 ADD COLUMN b int default 2; ALTER TABLE t2 ADD COLUMN b int default 2; |