diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-02-16 10:19:57 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-02-16 10:19:57 +0200 |
commit | 21e5335154e4eb689df90c52a6b55263cd2067fb (patch) | |
tree | 4c86b245cf7385b51316c7a890431ff17f695872 /mysql-test/suite/encryption | |
parent | d3fbff38b9e8d6395dccfde4388d46824e7152cd (diff) | |
download | mariadb-git-21e5335154e4eb689df90c52a6b55263cd2067fb.tar.gz |
MDEV-9962: encryption.innodb_encryption_filekeys stalled waiting for key encryption threads to decrypt all required spacesbb-10.1-MDEV-9962
Test changes.
Diffstat (limited to 'mysql-test/suite/encryption')
-rw-r--r-- | mysql-test/suite/encryption/r/innodb_encryption_filekeys.result | 24 | ||||
-rw-r--r-- | mysql-test/suite/encryption/t/innodb_encryption_filekeys.test | 35 |
2 files changed, 25 insertions, 34 deletions
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result index ab958004eab..1c8341137b4 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result +++ b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result @@ -1,6 +1,4 @@ -call mtr.add_suppression("trying to do an operation on a dropped tablespace .*"); SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encrypt_tables = OFF; SET GLOBAL innodb_encryption_threads = 4; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; @@ -14,24 +12,21 @@ t1 CREATE TABLE `t1` ( CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES; CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO; CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; -INSERT INTO t2 select * from t1; -INSERT INTO t3 select * from t1; -INSERT INTO t4 select * from t1; SET GLOBAL innodb_encrypt_tables = on; # Wait max 10 min for key encryption threads to encrypt required all spaces # Success! SELECT COUNT(1) FROM t1; COUNT(1) -400 +10 SELECT COUNT(1) FROM t2; COUNT(1) -400 +10 SELECT COUNT(1) FROM t3; COUNT(1) -400 +10 SELECT COUNT(1) FROM t4; COUNT(1) -400 +10 SET GLOBAL innodb_encrypt_tables = off; # Wait max 10 min for key encryption threads to decrypt all required spaces # Success! @@ -50,18 +45,17 @@ INSERT INTO t5 select * from t1; # Success! SELECT COUNT(1) FROM t1; COUNT(1) -400 +10 SELECT COUNT(1) FROM t2; COUNT(1) -400 +10 SELECT COUNT(1) FROM t3; COUNT(1) -400 +10 SELECT COUNT(1) FROM t4; COUNT(1) -400 +10 SELECT COUNT(1) FROM t5; COUNT(1) -400 +10 drop table t1,t2,t3,t4, t5; -set GLOBAL innodb_default_encryption_key_id=1; diff --git a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test index 8f0986071f1..f73e78aa5bf 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test +++ b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test @@ -1,21 +1,18 @@ -- source include/have_innodb.inc -- source include/have_file_key_management_plugin.inc -# embedded does not support restart --- source include/not_embedded.inc - -call mtr.add_suppression("trying to do an operation on a dropped tablespace .*"); --disable_query_log let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; let $encrypt_tables = `SELECT @@innodb_encrypt_tables`; let $threads = `SELECT @@innodb_encryption_threads`; +let $key_id = `SELECT @@innodb_default_encryption_key_id`; --enable_query_log +--disable_warnings SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encrypt_tables = OFF; SET GLOBAL innodb_encryption_threads = 4; +--enable_warnings CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; SHOW CREATE TABLE t1; @@ -25,21 +22,20 @@ CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNOD --disable_warnings --disable_query_log -set autocommit=0; -let $i = 400; +begin; +let $i = 10; while ($i) { INSERT INTO t1 values(NULL, substring(MD5(RAND()), -128)); dec $i; } -commit; -set autocommit=1; ---enable_warnings ---enable_query_log INSERT INTO t2 select * from t1; INSERT INTO t3 select * from t1; INSERT INTO t4 select * from t1; +commit; +--enable_warnings +--enable_query_log SET GLOBAL innodb_encrypt_tables = on; @@ -60,7 +56,7 @@ while ($cnt) } if (!$success) { - SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; + SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SHOW STATUS LIKE 'innodb_encryption%'; -- die Timeout waiting for encryption threads } @@ -90,7 +86,7 @@ while ($cnt) } if (!$success) { - SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; + SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SHOW STATUS LIKE 'innodb_encryption%'; -- die Timeout waiting for encryption threads } @@ -119,7 +115,7 @@ while ($cnt) } if (!$success) { - SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; + SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SHOW STATUS LIKE 'innodb_encryption%'; -- die Timeout waiting for encryption threads } @@ -131,15 +127,16 @@ SELECT COUNT(1) FROM t3; SELECT COUNT(1) FROM t4; SELECT COUNT(1) FROM t5; +drop table t1,t2,t3,t4, t5; + # reset system --disable_query_log -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; +--disable_warnings EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables; EVAL SET GLOBAL innodb_encryption_threads = $threads; +EVAL set GLOBAL innodb_default_encryption_key_id = $key_id; +--enable_warnings --enable_query_log -drop table t1,t2,t3,t4, t5; - -set GLOBAL innodb_default_encryption_key_id=1; |