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

Re-enable the encryption tests

parent 58f2c842
......@@ -13,7 +13,3 @@
innodb_scrub : 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("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;
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;
......@@ -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;
......
......@@ -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;
......@@ -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");
......
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