Debian Codegraph @

mysql-test/suite/group_replication/t/gr_default_table_encryption.test

raw
1 ################################################################################
2 # Validates that a member can only join a group when both the group and the new
3 # member have the value on the default_table_encryption global server option.
4 #
5 # Test:
6 # 0. This test requires 2 members.
7 # 1. Bootstrap a group on server 1 with
8 # GLOBAL.default_table_encryption = ON
9 # 2. Try join a member with
10 # GLOBAL.default_table_encryption = OFF
11 # to the group, it shall fail.
12 # 3. Try join a member with
13 # GLOBAL.default_table_encryption = ON
14 # to the group, it shall succeed.
15 # 4. Try to change GLOBAL.default_table_encryption while
16 # Group Replication is running, it shall fail.
17 # 5. Try to change SESSION.default_table_encryption while
18 # Group Replication is running, it shall succeed.
19 # 6. Try to PERSIST default_table_encryption while
20 # Group Replication is running, it shall fail.
21 # 7. Cleanup.
22 ################################################################################
23 --source include/have_group_replication_plugin.inc
24 --let $rpl_skip_group_replication_start= 1
25 --source include/group_replication.inc
26
27
28 --echo
29 --echo ############################################################
30 --echo # 1. Bootstrap a group on server 1 with
31 --echo # GLOBAL.default_table_encryption = ON
32 --let $rpl_connection_name= server1
33 --source include/rpl_connection.inc
34 SET @table_encryption_default= @@GLOBAL.default_table_encryption;
35 SET @@GLOBAL.default_table_encryption = ON;
36 --source include/start_and_bootstrap_group_replication.inc
37
38
39 --echo
40 --echo ############################################################
41 --echo # 2. Try join a member with
42 --echo # GLOBAL.default_table_encryption = OFF
43 --echo # to the group, it shall fail.
44 --let $rpl_connection_name= server2
45 --source include/rpl_connection.inc
46
47 SET SESSION sql_log_bin = 0;
48 call mtr.add_suppression("The member is configured with a default_table_encryption option value '0' different from the group '1'. The member will now exit the group.");
49 SET SESSION sql_log_bin = 1;
50
51 --disable_query_log
52 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
53 --enable_query_log
54
55 SET @table_encryption_default= @@GLOBAL.default_table_encryption;
56 SET @@GLOBAL.default_table_encryption = OFF;
57 --error ER_GROUP_REPLICATION_CONFIGURATION
58 START GROUP_REPLICATION;
59
60
61 --echo
62 --echo ############################################################
63 --echo # 3. Try join a member with
64 --echo # GLOBAL.default_table_encryption = ON
65 --echo # to the group, it shall succeed.
66 SET @@GLOBAL.default_table_encryption = ON;
67 --source include/start_group_replication.inc
68
69
70 --echo
71 --echo ############################################################
72 --echo # 4. Try to change GLOBAL.default_table_encryption while
73 --echo # Group Replication is running, it shall fail.
74 --error ER_GROUP_REPLICATION_RUNNING
75 SET @@GLOBAL.default_table_encryption = OFF;
76
77
78 --echo
79 --echo ############################################################
80 --echo # 5. Try to change SESSION.default_table_encryption while
81 --echo # Group Replication is running, it shall succeed.
82 SET @@SESSION.default_table_encryption = OFF;
83
84 --echo
85 --echo ############################################################
86 --echo # 6. Try to PERSIST default_table_encryption while
87 --echo # Group Replication is running, it shall fail.
88 --error ER_GROUP_REPLICATION_RUNNING
89 SET PERSIST default_table_encryption=ON;
90
91 --echo
92 --echo ############################################################
93 --echo # 7. Clean up.
94 --let $rpl_connection_name= server1
95 --source include/rpl_connection.inc
96 --source include/stop_group_replication.inc
97 SET @@GLOBAL.default_table_encryption= @table_encryption_default;
98
99 --let $rpl_connection_name= server2
100 --source include/rpl_connection.inc
101 --source include/stop_group_replication.inc
102 SET @@GLOBAL.default_table_encryption= @table_encryption_default;
103 SET @@SESSION.default_table_encryption= @table_encryption_default;
104
105 --source include/group_replication_end.inc