Debian Codegraph @

mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result

raw
1 #################
2 # Initialization
3 #################
4 include/rpl_init.inc [topology=1->2]
5 connection server_2;
6 include/stop_slave.inc
7 CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
8 call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
9 call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not decrypt binlog: encryption key error");
10 #####################################################
11 # Part 1: unencrypted master
12 #####################################################
13 connection server_1;
14 CREATE TABLE table1_no_encryption (
15 pk INT AUTO_INCREMENT PRIMARY KEY,
16 ts TIMESTAMP NULL,
17 b BLOB
18 ) ENGINE=MyISAM;
19 INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
20 INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
21 FLUSH BINARY LOGS;
22 SET binlog_format=ROW;
23 INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
24 INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
25 NOT FOUND /table1_no_encryption/ in master-bin.0*
26 #####################################################
27 # Part 2: restart master, now with binlog encryption
28 #####################################################
29 connection default;
30 connection server_1;
31 CREATE TABLE table2_to_encrypt (
32 pk INT AUTO_INCREMENT PRIMARY KEY,
33 ts TIMESTAMP NULL,
34 b BLOB
35 ) ENGINE=MyISAM;
36 INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
37 INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
38 FLUSH BINARY LOGS;
39 SET binlog_format=ROW;
40 INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
41 INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
42 NOT FOUND /table2_to_encrypt/ in master-bin.0*
43 #####################################################
44 # Part 3: restart master again without encryption
45 #####################################################
46 connection default;
47 connection server_1;
48 CREATE TABLE table3_no_encryption (
49 pk INT AUTO_INCREMENT PRIMARY KEY,
50 ts TIMESTAMP NULL,
51 b BLOB
52 ) ENGINE=MyISAM;
53 INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
54 INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
55 INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
56 #####################################################
57 # Check: resume replication and check how it goes
58 #####################################################
59 connection server_2;
60 start slave;
61 include/wait_for_slave_io_error.inc [errno=1236]
62 SELECT MASTER_GTID_WAIT("LAST_UNENCRYPTED_GTID", 60);
63 MASTER_GTID_WAIT("LAST_UNENCRYPTED_GTID", 60)
64 0
65 # Ensuring slave was unable to replicate any encrypted transactions..
66 # ..success
67 SHOW TABLES;
68 Tables_in_test
69 table1_no_encryption
70 include/stop_slave_sql.inc
71 reset slave;
72 ##########
73 # Cleanup
74 ##########
75 connection server_1;
76 reset master;
77 SELECT COUNT(*) FROM table1_no_encryption;
78 COUNT(*)
79 8
80 SELECT COUNT(*) FROM table2_to_encrypt;
81 COUNT(*)
82 8
83 SELECT COUNT(*) FROM table3_no_encryption;
84 COUNT(*)
85 4
86 DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
87 connection server_2;
88 RESET MASTER;
89 SET GLOBAL gtid_slave_pos= '';
90 include/start_slave.inc
91 include/rpl_end.inc