| 1 |
-- source include/have_innodb.inc |
| 2 |
-- source include/not_embedded.inc |
| 3 |
-- source filekeys_plugin.inc |
| 4 |
|
| 5 |
--echo # |
| 6 |
--echo # MDEV-9011: Redo log encryption does not work |
| 7 |
--echo # |
| 8 |
|
| 9 |
--echo # |
| 10 |
--echo # MDEV-9422 Encrypted redo log checksum errors |
| 11 |
--echo # on restart after killing busy server instance |
| 12 |
--echo # |
| 13 |
|
| 14 |
--let $MYSQLD_DATADIR=`select @@datadir` |
| 15 |
|
| 16 |
CREATE TABLE t0 ( |
| 17 |
pk bigint auto_increment, |
| 18 |
col_int int, |
| 19 |
col_int_key int, |
| 20 |
col_char char(12), |
| 21 |
col_char_key char(12), |
| 22 |
primary key (pk), |
| 23 |
key (col_int_key), |
| 24 |
key (col_char_key) |
| 25 |
) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1; |
| 26 |
CREATE TEMPORARY TABLE t LIKE t0; |
| 27 |
|
| 28 |
INSERT INTO t VALUES |
| 29 |
(NULL,1,1,'private','secret'),(NULL,2,2,'sacred','success'), |
| 30 |
(NULL,3,3,'story','secure'),(NULL,4,4,'security','sacrament'); |
| 31 |
|
| 32 |
# Force a redo log flush at the next commit. |
| 33 |
SET GLOBAL innodb_flush_log_at_trx_commit=1; |
| 34 |
INSERT INTO t0 |
| 35 |
SELECT NULL, t1.col_int, t1.col_int_key, t1.col_char, t1.col_char_key |
| 36 |
FROM t t1, t t2, t t3, t t4, t t5; |
| 37 |
|
| 38 |
--source include/kill_mysqld.inc |
| 39 |
|
| 40 |
--let SEARCH_RANGE = 10000000 |
| 41 |
--let SEARCH_PATTERN=private|secret|sacr(ed|ament)|success|story|secur(e|ity) |
| 42 |
|
| 43 |
--echo # ibdata1 expecting NOT FOUND |
| 44 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/ibdata1 |
| 45 |
-- source include/search_pattern_in_file.inc |
| 46 |
--echo # t0.ibd expecting NOT FOUND |
| 47 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t0.ibd |
| 48 |
-- source include/search_pattern_in_file.inc |
| 49 |
--echo # ib_logfile0 expecting NOT FOUND |
| 50 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0 |
| 51 |
-- source include/search_pattern_in_file.inc |
| 52 |
|
| 53 |
--echo # Restart without redo log encryption |
| 54 |
-- let $restart_parameters=--skip-innodb-encrypt-log |
| 55 |
-- source include/start_mysqld.inc |
| 56 |
|
| 57 |
SELECT COUNT(*) FROM t0; |
| 58 |
CHECK TABLE t0; |
| 59 |
# Force a redo log flush at the next commit. |
| 60 |
SET GLOBAL innodb_flush_log_at_trx_commit=1; |
| 61 |
# If we tested with UPDATE, we would get clear-text redo log for |
| 62 |
# encrypted undo log written with the old secret values. |
| 63 |
INSERT INTO t0 VALUES(NULL, 5, 5, 'public', 'gossip'); |
| 64 |
|
| 65 |
--source include/kill_mysqld.inc |
| 66 |
|
| 67 |
--echo # ib_logfile0 expecting NOT FOUND |
| 68 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0 |
| 69 |
-- source include/search_pattern_in_file.inc |
| 70 |
--let SEARCH_PATTERN=(public|gossip).* |
| 71 |
--echo # ib_logfile0 expecting FOUND |
| 72 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0 |
| 73 |
-- source include/search_pattern_in_file.inc |
| 74 |
|
| 75 |
--let SEARCH_PATTERN=private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip |
| 76 |
--echo # ibdata1 expecting NOT FOUND |
| 77 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/ibdata1 |
| 78 |
-- source include/search_pattern_in_file.inc |
| 79 |
--echo # t0.ibd expecting NOT FOUND |
| 80 |
-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t0.ibd |
| 81 |
-- source include/search_pattern_in_file.inc |
| 82 |
|
| 83 |
--let $restart_parameters= |
| 84 |
--source include/start_mysqld.inc |
| 85 |
|
| 86 |
SELECT COUNT(*) FROM t0; |
| 87 |
CHECK TABLE t0; |
| 88 |
DROP TABLE t0; |