Debian Codegraph @

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

raw
1 --source include/not_embedded.inc
2 #
3 # MDEV-18496 Crash when Aria encryption is enabled but plugin not available
4 #
5 call mtr.add_suppression('Unknown key id 1');
6 call mtr.add_suppression('try to repair it');
7 call mtr.add_suppression('Index is corrupted');
8 call mtr.add_suppression("Initialization of encryption failed.*");
9
10 set global aria_encrypt_tables= 1;
11 --error HA_ERR_NO_ENCRYPTION
12 create table t1 (pk int primary key, a int, key(a)) engine=aria transactional=1;
13 set global aria_encrypt_tables= default;
14
15 --echo #
16 --echo # MDEV-26258 Various crashes/asserts/corruptions when Aria encryption is
17 --echo # enabled/used, but the encryption plugin is not loaded
18 --echo #
19
20 SET GLOBAL aria_encrypt_tables=ON;
21
22 --write_file $MYSQLTEST_VARDIR/keys1.txt
23 1;770A8A65DA156D24EE2A093277530142
24 EOF
25
26 --replace_result \\ /
27 --error HA_ERR_NO_ENCRYPTION
28 CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria;
29
30 --echo # Restart with encryption enabled
31
32 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
33 --shutdown_server
34 --source include/wait_until_disconnected.inc
35 --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
36 --enable_reconnect
37 --source include/wait_until_connected_again.inc
38
39 CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria;
40 INSERT INTO t1 VALUES (4,0);
41 LOAD INDEX INTO CACHE t1 IGNORE LEAVES;
42 LOAD INDEX INTO CACHE t1;
43
44 # Restart without encryption. Above table should be unreadable
45
46 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
47 --shutdown_server
48 --source include/wait_until_disconnected.inc
49 --write_line "restart:--aria-encrypt-tables=0" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
50 --enable_reconnect
51 --source include/wait_until_connected_again.inc
52
53 --replace_result \\ /
54 --error HA_ERR_NO_ENCRYPTION
55 SELECT * FROM t1;
56 DROP TABLE t1;
57
58 --echo Cleanup
59 --remove_file $MYSQLTEST_VARDIR/keys1.txt