Debian Codegraph @

mysql-test/suite/maria/encrypt-wrong-key.test

raw
1 --source include/not_embedded.inc
2
3 #
4 # Test what happens if one removes a decryption key for Aria
5 #
6
7 call mtr.add_suppression("file_key_management");
8 call mtr.add_suppression("System key id 1 is missing");
9 call mtr.add_suppression("Unknown key id 1");
10 call mtr.add_suppression("Initialization of encryption failed.*");
11
12 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
13 --shutdown_server
14 --source include/wait_until_disconnected.inc
15
16 --write_file $MYSQLTEST_VARDIR/keys1.txt
17 1;770A8A65DA156D24EE2A093277530142
18 EOF
19
20 --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
21 --enable_reconnect
22 --source include/wait_until_connected_again.inc
23
24 CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
25 INSERT INTO t1 VALUES (1);
26
27 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
28 --shutdown_server
29 --source include/wait_until_disconnected.inc
30
31 --write_file $MYSQLTEST_VARDIR/keys2.txt
32 2;770A8A65DA156D24EE2A093277530143
33 EOF
34
35 --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
36 --enable_reconnect
37 --source include/wait_until_connected_again.inc
38
39 --replace_result \\ /
40 repair table t1;
41
42 --replace_result \\ /
43 --error HA_ERR_NO_ENCRYPTION
44 INSERT INTO t1 VALUES (2);
45
46 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
47 --shutdown_server
48 --source include/wait_until_disconnected.inc
49
50 --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
51 --enable_reconnect
52 --source include/wait_until_connected_again.inc
53
54 select * from t1;
55 drop table t1;
56 --remove_file $MYSQLTEST_VARDIR/keys1.txt
57 --remove_file $MYSQLTEST_VARDIR/keys2.txt