Debian Codegraph @

mysql-test/suite/group_replication/r/gr_key_rotation.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6 set sql_log_bin=0;
7 set sql_log_bin=1;
8 ALTER INSTANCE ROTATE INNODB MASTER KEY;
9 ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully.
10 INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
11 SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server1/keyring_server1';
12 SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
13 PLUGIN_NAME keyring_file
14 PLUGIN_VERSION 1.0
15 PLUGIN_STATUS ACTIVE
16 ALTER INSTANCE ROTATE INNODB MASTER KEY;
17 include/start_and_bootstrap_group_replication.inc
18 CREATE TABLE t1(c1 INT PRIMARY KEY, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB;
19 INSERT INTO t1 VALUES(1, "first");
20 INSERT INTO t1 VALUES(2, "second");
21 INSERT INTO t1 VALUES(3, "third");
22 CREATE TABLE t2 (c1 INT PRIMARY KEY,c2 INT,FOREIGN KEY(c2)REFERENCES t1(c1)ON DELETE RESTRICT);
23 INSERT INTO t2 VALUES(1,1);
24 INSERT INTO t2 VALUEs(2,2);
25 [connection server2]
26 set sql_log_bin=0;
27 set sql_log_bin=1;
28 ALTER INSTANCE ROTATE INNODB MASTER KEY;
29 ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully.
30 INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
31 SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server2/keyring_server2';
32 SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
33 PLUGIN_NAME keyring_file
34 PLUGIN_VERSION 1.0
35 PLUGIN_STATUS ACTIVE
36 include/start_group_replication.inc
37 UPDATE t2 SET c1=3 WHERE c1=2;
38 UPDATE t2 SET c2=NULL WHERE c2=3;
39 DELETE FROM t1 WHERE c1=3;
40 include/rpl_sync.inc
41 # check that t1 exists and has same values in both servers
42 include/diff_tables.inc [server1:t1, server2:t1]
43 # check that t2 exists and has same values in both servers
44 include/diff_tables.inc [server1:t2, server2:t2]
45 UNINSTALL PLUGIN keyring_file;
46 SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
47 INSERT INTO t1 VALUES(7,'seventh');
48 CREATE TABLE t3(c1 INT PRIMARY KEY, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB;
49 ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully.
50 ALTER INSTANCE ROTATE INNODB MASTER KEY;
51 ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully.
52 [connection server1]
53 CREATE TABLE t3(c1 INT PRIMARY KEY) ENCRYPTION="Y" ENGINE = InnoDB;
54 INSERT INTO t3 VALUES(1);
55 UPDATE t3 SET c1=2;
56 [connection server2]
57 SELECT * FROM t3;
58 ERROR 42S02: Table 'test.t3' doesn't exist
59 include/stop_group_replication.inc
60 INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
61 SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server2/keyring_server2';
62 SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
63 PLUGIN_NAME keyring_file
64 PLUGIN_VERSION 1.0
65 PLUGIN_STATUS ACTIVE
66 include/start_group_replication.inc
67 DELETE FROM t3 WHERE c1=1;
68 DELETE FROM t2 WHERE c1=1;
69 DELETE FROM t1 WHERE c1=1;
70 include/rpl_sync.inc
71 # check that t1 exists and has same values in both servers
72 include/diff_tables.inc [server1:t1, server2:t1]
73 # check that t2 exists and has same values in both servers
74 include/diff_tables.inc [server1:t2, server2:t2]
75 # check that t3 exists and has same values in both servers
76 [connection server1]
77 SET GLOBAL binlog_encryption=ON;
78 CREATE TABLE t4 (c1 TEXT,c2 INT AUTO_INCREMENT PRIMARY KEY);
79 # Adding debug point 'ensure_binlog_cache_temporary_file_is_encrypted' to @@GLOBAL.debug
80 INSERT INTO t4(c1) VALUES (REPEAT('123', 16384.0));
81 # Removing debug point 'ensure_binlog_cache_temporary_file_is_encrypted' from @@GLOBAL.debug
82 SET GLOBAL binlog_encryption = OFF;
83 include/rpl_sync.inc
84 # check that t4 exists and has same values in both servers
85 [connection server2]
86 UNINSTALL PLUGIN keyring_file;
87 [connection server1]
88 UNINSTALL PLUGIN keyring_file;
89 DROP TABLE t2;
90 DROP TABLE t3;
91 DROP TABLE t1;
92 DROP TABLE t4;
93 include/group_replication_end.inc