Commit 4d8617ab authored by Marko Mäkelä's avatar Marko Mäkelä

Re-enable the encryption tests

parent 58f2c842
...@@ -13,7 +13,3 @@ ...@@ -13,7 +13,3 @@
innodb_scrub : MDEV-8139 scrubbing does not work reliably innodb_scrub : MDEV-8139 scrubbing does not work reliably
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
innodb-bad-key-change : MDEV-11369 FIXME: nondeterministic result
innodb-bad-key-change2 : MDEV-11369 FIXME: nondeterministic result
innodb-bad-key-change3 : MDEV-11369 FIXME: nondeterministic result
innodb-bad-key-change4 : MDEV-11369 FIXME: nondeterministic result
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); 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("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("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"); call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
# Start server with keys2.txt # Start server with keys2.txt
...@@ -25,15 +26,17 @@ foobar 2 ...@@ -25,15 +26,17 @@ foobar 2
# Restart server with keysbad3.txt # Restart server with keysbad3.txt
SELECT * FROM t1; 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; SHOW WARNINGS;
Level Code Message 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 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 1932 Table 'test.t1' doesn't exist in engine
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
DROP TABLE t1; 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; SHOW WARNINGS;
Level Code Message 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 # Start server with keys3.txt
SET GLOBAL innodb_default_encryption_key_id=5; 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; 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); ...@@ -41,74 +44,63 @@ INSERT INTO t2 VALUES ('foobar',1,2);
# Restart server with keys2.txt # Restart server with keys2.txt
SELECT * FROM t2; 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; SHOW WARNINGS;
Level Code Message 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 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 1932 Table 'test.t2' doesn't exist in engine
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
SELECT * FROM t2 where id = 1; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
SELECT * FROM t2 where b = 1; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
INSERT INTO t2 VALUES ('tmp',3,3); 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
DELETE FROM t2 where b = 3; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
DELETE FROM t2 where id = 3; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
UPDATE t2 set b = b +1; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
OPTIMIZE TABLE t2; OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text 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 Table 'test.t2' doesn't exist in engine
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 status Operation failed
test.t2 optimize error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
ALTER TABLE t2 ADD COLUMN d INT; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
ANALYZE TABLE t2; ANALYZE TABLE t2;
Table Op Msg_type Msg_text 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 Table 'test.t2' doesn't exist in engine
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 status Operation failed
test.t2 analyze error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
TRUNCATE TABLE t2; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t2' doesn't exist in engine
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
DROP TABLE t2; DROP TABLE t2;
# Start server with keys2.txt # Start server with keys2.txt
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("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("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\."); 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 ...@@ -6,39 +7,37 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4; ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
SELECT * FROM t1; 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; SHOW WARNINGS;
Level Code Message 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 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 1932 Table 'test.t1' doesn't exist in engine
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
ALTER TABLE t1 ENGINE=InnoDB; 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; SHOW WARNINGS;
Level Code Message 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 1932 Table 'test.t1' doesn't exist in engine
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
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text 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 Table 'test.t1' doesn't exist in engine
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 status Operation failed
test.t1 optimize error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text 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 Table 'test.t1' doesn't exist in engine
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 status Operation failed
test.t1 check error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
backup: t1 backup: t1
UNLOCK TABLES; UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
Warnings: ERROR 42S02: Table 'test.t1' doesn't exist in engine
Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. DROP TABLE t1;
Warning 1812 Tablespace is missing for table 'test/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 restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 IMPORT TABLESPACE;
Warnings: Warnings:
...@@ -51,6 +50,7 @@ t1 CREATE TABLE `t1` ( ...@@ -51,6 +50,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`pk`) PRIMARY KEY (`pk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
RENAME TABLE t1 TO t1new; RENAME TABLE t1 TO t1new;
ALTER TABLE t1new RENAME TO t2new; ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
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 ALTER TABLE t1 RENAME TO t1new;
DROP TABLE t1new; ERROR 42S02: Table 'test.t1' doesn't exist in engine
DROP TABLE t1;
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("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"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
...@@ -7,16 +8,14 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); ...@@ -7,16 +8,14 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text 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 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 Table 'test.t1' doesn't exist in engine
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 status Operation failed
test.t1 optimize error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text 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 Table 'test.t1' doesn't exist in engine
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 status Operation failed
test.t1 check error Corrupt
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
DROP TABLE t1; DROP TABLE t1;
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); 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("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("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"); call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
...@@ -36,7 +37,7 @@ SELECT * FROM t1; ...@@ -36,7 +37,7 @@ SELECT * FROM t1;
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1; SELECT * FROM t1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
...@@ -66,45 +67,45 @@ INSERT INTO t2 VALUES ('foobar',1,2); ...@@ -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 -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2; SELECT * FROM t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2 where id = 1; SELECT * FROM t2 where id = 1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2 where b = 1; SELECT * FROM t2 where b = 1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
INSERT INTO t2 VALUES ('tmp',3,3); INSERT INTO t2 VALUES ('tmp',3,3);
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
DELETE FROM t2 where b = 3; DELETE FROM t2 where b = 3;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
DELETE FROM t2 where id = 3; DELETE FROM t2 where id = 3;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
UPDATE t2 set b = b +1; UPDATE t2 set b = b +1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
OPTIMIZE TABLE t2; OPTIMIZE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t2 ADD COLUMN d INT; ALTER TABLE t2 ADD COLUMN d INT;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
ANALYZE TABLE t2; ANALYZE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
TRUNCATE TABLE t2; TRUNCATE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # 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 # 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\\."); 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 # 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("Couldn't load plugins from 'file_key_management");
...@@ -25,11 +26,11 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); ...@@ -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 --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 --source include/restart_mysqld.inc
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1; SELECT * FROM t1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
--error ER_GET_ERRMSG --error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 ENGINE=InnoDB; ALTER TABLE t1 ENGINE=InnoDB;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS; SHOW WARNINGS;
...@@ -56,8 +57,13 @@ UNLOCK TABLES; ...@@ -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 --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 --source include/restart_mysqld.inc
# Discard should pass even with incorrect keys --error ER_NO_SUCH_TABLE_IN_ENGINE
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / 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; ALTER TABLE t1 DISCARD TABLESPACE;
perl; perl;
...@@ -66,7 +72,6 @@ ib_discard_tablespaces("test", "t1"); ...@@ -66,7 +72,6 @@ ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1"); ib_restore_tablespaces("test", "t1");
EOF 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 --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 --source include/restart_mysqld.inc
...@@ -76,13 +81,10 @@ SHOW CREATE TABLE t1; ...@@ -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 --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 --source include/restart_mysqld.inc
# Rename table should pass even with incorrect keys --error ER_ERROR_ON_RENAME
RENAME TABLE t1 TO t1new; RENAME TABLE t1 TO t1new;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 RENAME TO t1new;
# Alter table rename is not allowed with incorrect keys
--error ER_GET_ERRMSG
ALTER TABLE t1new RENAME TO t2new;
# Drop should pass even with incorrect keys # Drop should pass even with incorrect keys
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
DROP TABLE t1new; DROP TABLE t1;
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # 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\\."); 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 # 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("Couldn't load plugins from 'file_key_management");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment