| 1 |
SHOW VARIABLES LIKE 'innodb_encrypt%'; |
| 2 |
Variable_name Value |
| 3 |
innodb_encrypt_log ON |
| 4 |
innodb_encrypt_tables ON |
| 5 |
innodb_encrypt_temporary_tables OFF |
| 6 |
innodb_encryption_rotate_key_age 1 |
| 7 |
innodb_encryption_rotation_iops 100 |
| 8 |
innodb_encryption_threads 1 |
| 9 |
SET GLOBAL innodb_encrypt_tables = ON; |
| 10 |
CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, |
| 11 |
f3 int not null, index(f1), index idx_1(f2), |
| 12 |
index(f2, f3)) ENGINE=InnoDB; |
| 13 |
# Wait max 10 min for key encryption threads to encrypt all spaces |
| 14 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; |
| 15 |
NAME |
| 16 |
innodb_system |
| 17 |
mysql/innodb_index_stats |
| 18 |
mysql/innodb_table_stats |
| 19 |
mysql/transaction_registry |
| 20 |
test/t1 |
| 21 |
CREATE TABLE t2 (f1 int not null)engine=innodb; |
| 22 |
# restart: --debug-dbug=d,ib_log_checkpoint_avoid |
| 23 |
connect con1,localhost,root,,,; |
| 24 |
begin; |
| 25 |
insert into t2 values(1); |
| 26 |
connection default; |
| 27 |
set global innodb_encrypt_tables = OFF; |
| 28 |
# Wait max 10 min for key encryption threads to decrypt all spaces |
| 29 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; |
| 30 |
NAME |
| 31 |
innodb_system |
| 32 |
mysql/innodb_index_stats |
| 33 |
mysql/innodb_table_stats |
| 34 |
mysql/transaction_registry |
| 35 |
test/t1 |
| 36 |
test/t2 |
| 37 |
alter table t1 drop index idx_1; |
| 38 |
set global innodb_encrypt_tables = ON; |
| 39 |
# Wait max 10 min for key encryption threads to encrypt all spaces |
| 40 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; |
| 41 |
NAME |
| 42 |
innodb_system |
| 43 |
mysql/innodb_index_stats |
| 44 |
mysql/innodb_table_stats |
| 45 |
mysql/transaction_registry |
| 46 |
test/t1 |
| 47 |
test/t2 |
| 48 |
disconnect con1; |
| 49 |
# restart: --debug-dbug=d,ib_log_checkpoint_avoid |
| 50 |
drop table t1, t2; |
| 51 |
CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, |
| 52 |
f3 int not null, index(f1), index idx_1(f2), |
| 53 |
index(f2, f3)) ENGINE=InnoDB; |
| 54 |
# Wait max 10 min for key encryption threads to encrypt all spaces |
| 55 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; |
| 56 |
NAME |
| 57 |
innodb_system |
| 58 |
mysql/innodb_index_stats |
| 59 |
mysql/innodb_table_stats |
| 60 |
mysql/transaction_registry |
| 61 |
test/t1 |
| 62 |
CREATE TABLE t2 (f1 int not null)engine=innodb; |
| 63 |
# restart: --debug-dbug=d,ib_log_checkpoint_avoid |
| 64 |
connect con1,localhost,root,,,; |
| 65 |
begin; |
| 66 |
insert into t2 values(1); |
| 67 |
connection default; |
| 68 |
set global innodb_encrypt_tables = OFF; |
| 69 |
# Wait max 10 min for key encryption threads to decrypt all spaces |
| 70 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; |
| 71 |
NAME |
| 72 |
innodb_system |
| 73 |
mysql/innodb_index_stats |
| 74 |
mysql/innodb_table_stats |
| 75 |
mysql/transaction_registry |
| 76 |
test/t1 |
| 77 |
test/t2 |
| 78 |
alter table t1 drop index idx_1; |
| 79 |
disconnect con1; |
| 80 |
# restart: --debug-dbug=d,ib_log_checkpoint_avoid |
| 81 |
connect con1,localhost,root,,,; |
| 82 |
begin; |
| 83 |
insert into t2 values(1); |
| 84 |
connection default; |
| 85 |
set global innodb_encrypt_tables = ON; |
| 86 |
# Wait max 10 min for key encryption threads to encrypt all spaces |
| 87 |
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; |
| 88 |
NAME |
| 89 |
innodb_system |
| 90 |
mysql/innodb_index_stats |
| 91 |
mysql/innodb_table_stats |
| 92 |
mysql/transaction_registry |
| 93 |
test/t1 |
| 94 |
test/t2 |
| 95 |
disconnect con1; |
| 96 |
drop table t2, t1; |