2017-05-05 10:25:29 +03:00
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\\.");
2018-02-16 21:02:35 +02:00
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
2018-12-21 09:43:35 +02:00
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
2019-04-03 16:10:20 +03:00
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
2016-10-27 14:51:10 +03:00
# 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;
CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t3(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=NO;
INSERT INTO t1(b) VALUES ('thisissecredmessage');
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t1;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT * FROM t1;
# Restart server with keys3.txt
set global innodb_encryption_rotate_key_age = 1;
use test;
CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
SELECT SLEEP(5);
SLEEP(5)
0
SELECT COUNT(1) FROM t3;
COUNT(1)
2048
SELECT COUNT(1) FROM t2;
COUNT(1)
2048
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
2019-04-03 16:10:20 +03:00
ERROR 42S02: Table 'test.t1' doesn't exist in engine
2016-10-27 14:51:10 +03:00
SELECT COUNT(1) FROM t1 where b = 'ab';
2019-04-03 16:10:20 +03:00
ERROR 42S02: Table 'test.t1' doesn't exist in engine
2016-10-27 14:51:10 +03:00
SELECT COUNT(1) FROM t1;
2019-04-03 16:10:20 +03:00
ERROR 42S02: Table 'test.t1' doesn't exist in engine
2016-10-27 14:51:10 +03:00
# Start server with keys2.txt
SELECT COUNT(1) FROM t1;
COUNT(1)
2048
SELECT COUNT(1) FROM t2;
COUNT(1)
2048
SELECT COUNT(1) FROM t3;
COUNT(1)
2048
DROP TABLE t1, t2, t3;