Debian Codegraph @

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

raw
1 ################################################################################
2 ## This test proves that group replication does not start on server when it's
3 ## lower_case_table_names does not match with the group.
4 ##
5 ## Test:
6 ## 0. This test requires 2 members.
7 ## 1. Verify lower_case_table_names cannot be set while server is
8 ## running and start GR on server-1.
9 ## 2. Store variables of server-2 for restart.
10 ## 3. Test GR does not start on server when lower_case_table_names
11 ## does not match.
12 ## 3A. Test GR does not start on boot when lower_case_table_names
13 ## does not match.
14 ## 3B. Test GR does not start with command when lower_case_table_names
15 ## does not match.
16 ## 4. Cleanup.
17 ################################################################################
18
19 --source include/big_test.inc
20 --source include/have_debug_sync.inc
21 --source include/have_group_replication_plugin.inc
22 --let $rpl_skip_group_replication_start= 1
23 --source include/group_replication.inc
24 --source include/force_restart.inc
25
26 --let $allow_rpl_inited=1
27
28 --echo
29 --echo ## 1. Verify lower_case_table_names cannot be set while server is
30 --echo ## running and start GR on server-1.
31 --echo
32 --let $rpl_connection_name= server1
33 --source include/rpl_connection.inc
34
35 ## Verify lower_case_table_names cannot be set while server is running.
36 ## This make sures we do not need to test variable changes while GR is running.
37 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
38 SET GLOBAL lower_case_table_names= 1;
39
40 --source include/start_and_bootstrap_group_replication.inc
41
42 --echo
43 --echo ## 2. Store variables of server-2 for restart.
44 --echo
45 --let $rpl_connection_name= server2
46 --source include/rpl_connection.inc
47
48 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
49 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
50 --let $_group_replication_comm_stack= `SELECT @@GLOBAL.group_replication_communication_stack`
51
52 set session sql_log_bin=0;
53 call mtr.add_suppression("The member is configured with a lower_case_table_names option value .*");
54 call mtr.add_suppression("lower_case_table_names was set to 2, .*");
55 set session sql_log_bin=1;
56
57 --echo
58 --echo ## 3A. Test GR does not start on boot when lower_case_table_names
59 --echo ## does not match. And verifies only one member is shown in the
60 --echo ## group as the join failed.
61 --echo
62
63 --let $restart_parameters=restart:--group_replication_start_on_boot=1 --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_group_name=$group_replication_group_name --group_replication_communication_stack=$_group_replication_comm_stack --lower_case_table_names=2 --loose-debug="+d,group_replication_wait_before_leave_on_error"
64 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $_group_replication_comm_stack GROUP_REPLICATION_COMMUNICATION_STACK
65 --source include/restart_mysqld.inc
66
67 #Needed as we are not using rpl_restart_server.inc
68 --let $rpl_server_number= 2
69 --source include/rpl_reconnect.inc
70
71 # Wait for the debug sync to be reached.
72 SET DEBUG_SYNC= "now WAIT_FOR signal.wait_leave_process";
73
74 --let $assert_text= 'Assert group has one member'
75 --let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members]" = 1
76 --source include/assert.inc
77
78 --let $assert_text= 'Assert server-2 is OFFLINE'
79 --let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members WHERE MEMBER_STATE=\"OFFLINE\"]" = 1
80 --source include/assert.inc
81
82 # now unblock debug sync point
83 SET DEBUG_SYNC= "now SIGNAL signal.continue_leave_process";
84
85 --echo
86 --echo ## 3B. Test GR does not start with command when lower_case_table_names
87 --echo ## does not match.
88 --echo
89
90 --error ER_GROUP_REPLICATION_CONFIGURATION
91 START GROUP_REPLICATION;
92
93 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
94 --let $assert_text = Found the expected error about lower_case_table_names
95 --let $assert_select = The member is configured with a lower_case_table_names option value
96 --let $assert_count = 2
97 --source include/assert_grep.inc
98
99 --let $assert_text= 'Assert server-2 is OFFLINE'
100 --let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members WHERE MEMBER_STATE=\"OFFLINE\"]" = 1
101 --source include/assert.inc
102
103 --echo
104 --echo ## 4. Cleanup.
105 --echo
106
107 --source include/group_replication_end.inc