| 1 |
# WL#9290 InnoDB: Support transparent tablespace data encryption for redo log |
| 2 |
# This test case will test basic redo log encryption support features. |
| 3 |
|
| 4 |
--source include/no_valgrind_without_big.inc |
| 5 |
--source include/have_innodb_max_16k.inc |
| 6 |
|
| 7 |
--disable_query_log |
| 8 |
call mtr.add_suppression("\\[Warning\\] .* Ignoring tablespace .* because it could not be opened"); |
| 9 |
call mtr.add_suppression("\\[Error\\] .* Encryption can't find master key, please check the keyring plugin is loaded."); |
| 10 |
call mtr.add_suppression("\\[ERROR\\] .* Failed to find tablespace for table `\.\.*`\.`\.\.*` in the cache."); |
| 11 |
call mtr.add_suppression("\\[ERROR\\] .* Operating system error number 2 in a file operation."); |
| 12 |
call mtr.add_suppression("\\[ERROR\\] .* The error means the system cannot find the path specified."); |
| 13 |
call mtr.add_suppression("\\[ERROR\\] .* Could not find a valid tablespace file for"); |
| 14 |
call mtr.add_suppression("\\[ERROR\\] .* If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them."); |
| 15 |
call mtr.add_suppression("\\[ERROR\\] .* Can't set redo log files to be encrypted."); |
| 16 |
--enable_query_log |
| 17 |
|
| 18 |
CREATE TABLE t1(c1 INT, c2 char(20)) ENGINE = InnoDB; |
| 19 |
|
| 20 |
SHOW CREATE TABLE t1; |
| 21 |
|
| 22 |
INSERT INTO t1 VALUES(0, "aaaaa"); |
| 23 |
INSERT INTO t1 VALUES(1, "bbbbb"); |
| 24 |
INSERT INTO t1 VALUES(2, "ccccc"); |
| 25 |
INSERT INTO t1 VALUES(3, "ddddd"); |
| 26 |
INSERT INTO t1 VALUES(4, "eeeee"); |
| 27 |
INSERT INTO t1 VALUES(5, "fffff"); |
| 28 |
INSERT INTO t1 VALUES(6, "ggggg"); |
| 29 |
INSERT INTO t1 VALUES(7, "hhhhh"); |
| 30 |
INSERT INTO t1 VALUES(8, "iiiii"); |
| 31 |
INSERT INTO t1 VALUES(9, "jjjjj"); |
| 32 |
INSERT INTO t1 select * from t1; |
| 33 |
INSERT INTO t1 select * from t1; |
| 34 |
INSERT INTO t1 select * from t1; |
| 35 |
INSERT INTO t1 select * from t1; |
| 36 |
INSERT INTO t1 select * from t1; |
| 37 |
INSERT INTO t1 select * from t1; |
| 38 |
|
| 39 |
SELECT * FROM t1 ORDER BY c1 LIMIT 10; |
| 40 |
|
| 41 |
# Restart to confirm the encryption info can be retrieved properly. |
| 42 |
let $restart_parameters = restart:; |
| 43 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH |
| 44 |
--replace_regex /\.dll/.so/ |
| 45 |
--source include/restart_mysqld.inc |
| 46 |
|
| 47 |
SELECT * FROM t1 ORDER BY c1 LIMIT 10; |
| 48 |
|
| 49 |
DROP TABLE t1; |
| 50 |
|
| 51 |
# Crash/recovery test. |
| 52 |
CREATE TABLE t1(c1 INT, c2 char(20)) ENGINE = InnoDB; |
| 53 |
|
| 54 |
INSERT INTO t1 VALUES(0, "aaaaa"); |
| 55 |
INSERT INTO t1 VALUES(1, "bbbbb"); |
| 56 |
INSERT INTO t1 VALUES(2, "ccccc"); |
| 57 |
INSERT INTO t1 VALUES(3, "ddddd"); |
| 58 |
INSERT INTO t1 VALUES(4, "eeeee"); |
| 59 |
INSERT INTO t1 VALUES(5, "fffff"); |
| 60 |
INSERT INTO t1 VALUES(6, "ggggg"); |
| 61 |
INSERT INTO t1 VALUES(7, "hhhhh"); |
| 62 |
INSERT INTO t1 VALUES(8, "iiiii"); |
| 63 |
INSERT INTO t1 VALUES(9, "jjjjj"); |
| 64 |
|
| 65 |
# Restart to confirm the encryption info can be retrieved properly. |
| 66 |
--source include/kill_mysqld.inc |
| 67 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH |
| 68 |
--replace_regex /\.dll/.so/ |
| 69 |
--source include/start_mysqld.inc |
| 70 |
|
| 71 |
SELECT * FROM t1 ORDER BY c1 LIMIT 10; |
| 72 |
DELETE FROM t1; |
| 73 |
|
| 74 |
START TRANSACTION; |
| 75 |
INSERT INTO t1 VALUES(0, "aaaaa"); |
| 76 |
INSERT INTO t1 VALUES(1, "bbbbb"); |
| 77 |
INSERT INTO t1 VALUES(2, "ccccc"); |
| 78 |
INSERT INTO t1 VALUES(3, "ddddd"); |
| 79 |
INSERT INTO t1 VALUES(4, "eeeee"); |
| 80 |
INSERT INTO t1 VALUES(5, "fffff"); |
| 81 |
INSERT INTO t1 VALUES(6, "ggggg"); |
| 82 |
INSERT INTO t1 VALUES(7, "hhhhh"); |
| 83 |
INSERT INTO t1 VALUES(8, "iiiii"); |
| 84 |
INSERT INTO t1 VALUES(9, "jjjjj"); |
| 85 |
|
| 86 |
# Restart to confirm the encryption info can be retrieved properly. |
| 87 |
let $restart_parameters = restart:; |
| 88 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH |
| 89 |
--replace_regex /\.dll/.so/ |
| 90 |
--source include/restart_mysqld.inc |
| 91 |
|
| 92 |
SELECT * FROM t1 ORDER BY c1 LIMIT 10; |
| 93 |
|
| 94 |
INSERT INTO t1 VALUES(0, "aaaaa"); |
| 95 |
INSERT INTO t1 VALUES(1, "bbbbb"); |
| 96 |
INSERT INTO t1 VALUES(2, "ccccc"); |
| 97 |
INSERT INTO t1 VALUES(3, "ddddd"); |
| 98 |
INSERT INTO t1 VALUES(4, "eeeee"); |
| 99 |
INSERT INTO t1 VALUES(5, "fffff"); |
| 100 |
INSERT INTO t1 VALUES(6, "ggggg"); |
| 101 |
INSERT INTO t1 VALUES(7, "hhhhh"); |
| 102 |
INSERT INTO t1 VALUES(8, "iiiii"); |
| 103 |
INSERT INTO t1 VALUES(9, "jjjjj"); |
| 104 |
|
| 105 |
SELECT * FROM t1 ORDER BY c1 LIMIT 10; |
| 106 |
|
| 107 |
# Cleanup |
| 108 |
DROP TABLE t1; |