| 1 |
-- source include/have_innodb.inc |
| 2 |
-- source include/have_debug.inc |
| 3 |
-- source include/innodb_undo_tablespaces.inc |
| 4 |
-- source include/not_embedded.inc |
| 5 |
|
| 6 |
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[0-9]*\\] in file"); |
| 7 |
if (`select count(*) = 0 from information_schema.plugins |
| 8 |
where plugin_name = 'debug_key_management' and plugin_status='active'`) |
| 9 |
{ |
| 10 |
--skip Needs debug_key_management |
| 11 |
} |
| 12 |
|
| 13 |
create table t1(a serial) engine=innoDB; |
| 14 |
|
| 15 |
set global innodb_encrypt_tables=ON; |
| 16 |
show variables like 'innodb_encrypt%'; |
| 17 |
|
| 18 |
--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` |
| 19 |
let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=1; |
| 20 |
--source include/wait_condition.inc |
| 21 |
|
| 22 |
select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1; |
| 23 |
set global debug_key_management_version=10; |
| 24 |
|
| 25 |
let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=10; |
| 26 |
--source include/wait_condition.inc |
| 27 |
select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10; |
| 28 |
|
| 29 |
# Test redo log key rotation and crash recovery. |
| 30 |
SET GLOBAL innodb_log_checkpoint_now = 1; |
| 31 |
SET GLOBAL innodb_flush_log_at_trx_commit = 1; |
| 32 |
INSERT INTO t1 VALUES(NULL); |
| 33 |
let $shutdown_timeout = 0; |
| 34 |
-- source include/restart_mysqld.inc |
| 35 |
|
| 36 |
# Note that we expect that key_version is increasing so disable encryption before reset |
| 37 |
|
| 38 |
set global innodb_encrypt_tables=OFF; |
| 39 |
set global debug_key_management_version=1; |
| 40 |
|
| 41 |
select * from t1; |
| 42 |
|
| 43 |
drop table t1; |