|
| 1 | +CREATE TABLE t1( |
| 2 | + a INT NOT NULL PRIMARY KEY, |
| 3 | + c CHAR(200), |
| 4 | + b BLOB, |
| 5 | + INDEX(b(10))) ENGINE=innodb ROW_FORMAT=compressed ENCRYPTION='Y'; |
| 6 | + |
| 7 | +CREATE TABLE t2( |
| 8 | + a INT NOT NULL PRIMARY KEY, |
| 9 | + c CHAR(200), |
| 10 | + b BLOB, |
| 11 | + INDEX(b(10))) ENGINE=innodb ROW_FORMAT=compressed ENCRYPTION='Y'; |
| 12 | + |
| 13 | +CREATE TABLE t3( |
| 14 | + a INT NOT NULL PRIMARY KEY, |
| 15 | + c CHAR(200), |
| 16 | + b BLOB, |
| 17 | + INDEX(b(10))) ENGINE=innodb ENCRYPTION='Y'; |
| 18 | + |
| 19 | +CREATE TABLE t4( |
| 20 | + a INT NOT NULL PRIMARY KEY, |
| 21 | + c CHAR(200), |
| 22 | + b BLOB, |
| 23 | + INDEX(b(10))) ENGINE=innodb ENCRYPTION='Y'; |
| 24 | + |
| 25 | +--source include/restart_mysqld.inc |
| 26 | + |
| 27 | +--source include/no_checkpoint_start.inc |
| 28 | + |
| 29 | +--disable_query_log |
| 30 | +--let $i = 20 |
| 31 | +BEGIN; |
| 32 | +WHILE ($i) |
| 33 | +{ |
| 34 | + eval INSERT INTO t1(a,c,b) VALUES ($i, REPEAT('secret1',20), REPEAT('secret2',6000)); |
| 35 | + dec $i; |
| 36 | +} |
| 37 | +--enable_query_log |
| 38 | + |
| 39 | +INSERT INTO t2 SELECT * FROM t1; |
| 40 | +INSERT INTO t3 SELECT * FROM t1; |
| 41 | +INSERT INTO t4 SELECT * FROM t1; |
| 42 | +COMMIT; |
| 43 | + |
| 44 | +# If checkpoint happens we will skip this test. |
| 45 | +# If no checkpoint happens, InnoDB refuses to |
| 46 | +# start as used encryption key is not found. |
| 47 | + |
| 48 | +SET GLOBAL innodb_flush_log_at_trx_commit=1; |
| 49 | +BEGIN; |
| 50 | +UPDATE t1 SET c = REPEAT('secret3', 20); |
| 51 | +UPDATE t2 SET c = REPEAT('secret4', 20); |
| 52 | +UPDATE t3 set c = REPEAT('secret4', 20); |
| 53 | +UPDATE t4 set c = REPEAT('secret4', 20); |
| 54 | +INSERT INTO t1 (a,c,b) VALUES (21, REPEAT('secret5',20), REPEAT('secret6',6000)); |
| 55 | +INSERT INTO t2 (a,c,b) VALUES (21, REPEAT('secret7',20), REPEAT('secret8',6000)); |
| 56 | +INSERT into t3 (a,c,b) VALUES (21, REPEAT('secret9',20), REPEAT('secre10',6000)); |
| 57 | +INSERT into t4 (a,c,b) VALUES (21, REPEAT('secre11',20), REPEAT('secre12',6000)); |
| 58 | +COMMIT; |
| 59 | + |
| 60 | +let $cleanup= drop TABLE t1,t2,t3,t4; |
| 61 | +--let CLEANUP_IF_CHECKPOINT= $cleanup; |
| 62 | +--source include/no_checkpoint_end.inc |
| 63 | + |
| 64 | +--echo # Restart mysqld without keyring plugin |
| 65 | + |
| 66 | +--error 1 |
| 67 | +--exec $MYSQLD_CMD |
| 68 | + |
| 69 | +--echo # Restart mysqld with keyring plugin |
| 70 | +--let $restart_parameters=restart:--early-plugin-load="keyring_file=$KEYRING_PLUGIN" --keyring-file-data=$MYSQLTEST_VARDIR/std_data/keys2.txt |
| 71 | +--source include/start_mysqld_no_echo.inc |
| 72 | + |
| 73 | +drop TABLE t1,t2,t3,t4; |
0 commit comments