Debian Codegraph @

mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test

raw
1 -- source include/have_innodb.inc
2 -- source include/not_embedded.inc
3 -- source include/have_file_key_management_plugin.inc
4
5 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
6 show warnings;
7 create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
8 show warnings;
9 create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
10 show warnings;
11 create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
12 show warnings;
13 create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
14 show warnings;
15
16 show create table innodb_compact;
17 show create table innodb_compressed;
18 show create table innodb_dynamic;
19 show create table innodb_redundant;
20
21 FLUSH TABLES innodb_normal FOR EXPORT; UNLOCK TABLES;
22 FLUSH TABLES innodb_compact FOR EXPORT; UNLOCK TABLES;
23 FLUSH TABLES innodb_compressed FOR EXPORT; UNLOCK TABLES;
24 FLUSH TABLES innodb_dynamic FOR EXPORT; UNLOCK TABLES;
25 FLUSH TABLES innodb_redundant FOR EXPORT; UNLOCK TABLES;
26
27 select variable_value > 0 from information_schema.global_status
28 where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED';
29
30 --source include/restart_mysqld.inc
31
32 BEGIN;
33 INSERT INTO innodb_normal SET c1 = 1;
34 INSERT INTO innodb_compact SET c1 = 1;
35 INSERT INTO innodb_compressed SET c1 = 1;
36 INSERT INTO innodb_dynamic SET c1 = 1;
37 INSERT INTO innodb_redundant SET c1 = 1;
38 COMMIT;
39
40 FLUSH TABLES innodb_normal FOR EXPORT; UNLOCK TABLES;
41 FLUSH TABLES innodb_compact FOR EXPORT; UNLOCK TABLES;
42 FLUSH TABLES innodb_compressed FOR EXPORT; UNLOCK TABLES;
43 FLUSH TABLES innodb_dynamic FOR EXPORT; UNLOCK TABLES;
44 FLUSH TABLES innodb_redundant FOR EXPORT; UNLOCK TABLES;
45
46 select variable_name from information_schema.global_status
47 where variable_value > 0 and variable_name
48 IN ('INNODB_NUM_PAGES_ENCRYPTED','INNODB_NUM_PAGES_DECRYPTED');
49
50 SET GLOBAL innodb_encrypt_tables=OFF;
51 alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
52 show create table innodb_compact;
53 alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
54 show create table innodb_compressed;
55 alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
56 show create table innodb_dynamic;
57 alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
58 show create table innodb_redundant;
59
60 FLUSH TABLES innodb_normal FOR EXPORT; UNLOCK TABLES;
61 FLUSH TABLES innodb_compact FOR EXPORT; UNLOCK TABLES;
62 FLUSH TABLES innodb_compressed FOR EXPORT; UNLOCK TABLES;
63 FLUSH TABLES innodb_dynamic FOR EXPORT; UNLOCK TABLES;
64 FLUSH TABLES innodb_redundant FOR EXPORT; UNLOCK TABLES;
65
66 drop table innodb_normal;
67 drop table innodb_compact;
68 drop table innodb_compressed;
69 drop table innodb_dynamic;
70 drop table innodb_redundant;
71 #
72 # MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
73 #
74 CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES;
75 INSERT INTO t1 VALUES (1),(2);
76
77 --echo # Restarting server...
78 --source include/restart_mysqld.inc
79
80 SELECT * FROM t1;
81
82 DROP TABLE t1;