Debian Codegraph @

mysql-test/suite/encryption/t/create_or_replace_big.test

raw
1 --source include/have_innodb.inc
2 --source include/have_file_key_management_plugin.inc
3 --source include/not_embedded.inc
4 # This is needed for longer testcase timeout at least P7/P8
5 --source include/big_test.inc
6
7 #
8 # MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
9 #
10 SET default_storage_engine = InnoDB;
11
12 CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
13 CREATE TABLE t2 AS SELECT * FROM t1;
14
15 --disable_abort_on_error
16 --disable_warnings
17 --disable_query_log
18
19 let $i = 40;
20 while ($i)
21 {
22 SET GLOBAL innodb_encrypt_tables = ON;
23 SET GLOBAL innodb_encryption_threads = 1;
24 CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
25 CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
26 SET GLOBAL innodb_encryption_rotation_iops = 100;
27 SET GLOBAL innodb_encrypt_tables = OFF;
28 CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
29 CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
30 dec $i;
31 }
32
33 --enable_abort_on_error
34 --enable_warnings
35 --enable_query_log
36
37 drop table t1,t2;
38 SET GLOBAL innodb_encryption_threads = 0;
39
40 #
41 # MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
42 #
43
44 SET GLOBAL innodb_encryption_threads = 4;
45
46 CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
47 INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
48
49 CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
50
51 CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
52
53 INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
54 INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
55 INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
56 INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
57
58 --echo # Wait max 10 min for key encryption threads to decrypt all spaces
59 let $cnt=600;
60 while ($cnt)
61 {
62 let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
63 if ($success)
64 {
65 let $cnt=0;
66 }
67 if (!$success)
68 {
69 real_sleep 1;
70 dec $cnt;
71 }
72 }
73 if (!$success)
74 {
75 SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
76 SHOW STATUS LIKE 'innodb_encryption%';
77 -- die Timeout waiting for encryption threads
78 }
79 --echo # Success!
80
81 SET GLOBAL innodb_encryption_threads = 0;
82 SET GLOBAL innodb_encrypt_tables = OFF;
83
84 DROP TABLE table0_int_autoinc, table1_int_autoinc, table10_int_autoinc;
85
86 -- source include/restart_mysqld.inc