Debian Codegraph @

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

raw
1 ################################################################################
2 ## This test proves that group replication does start on server when its
3 ## lower_case_table_names does 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 start on server when lower_case_table_names matches.
11 ## 3A. Test GR start with command when lower_case_table_names matches.
12 ## 3B. Test GR start on boot when lower_case_table_names matches.
13 ## 4. Cleanup.
14 ################################################################################
15
16 --source include/big_test.inc
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20 --source include/force_restart.inc
21
22 --let $allow_rpl_inited=1
23
24 --echo
25 --echo ## 1. Verify lower_case_table_names cannot be set while server is
26 --echo ## running and start GR on server-1.
27 --echo
28 --let $rpl_connection_name= server1
29 --source include/rpl_connection.inc
30
31 ## Verify lower_case_table_names cannot be set while server is running.
32 ## This make sures we do not need to test variable changes while GR is running.
33 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
34 SET GLOBAL lower_case_table_names= 1;
35
36 --source include/start_and_bootstrap_group_replication.inc
37
38 --echo
39 --echo ## 2. Store variables of server-2 for restart.
40 --echo
41 --let $rpl_connection_name= server2
42 --source include/rpl_connection.inc
43
44 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
45 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
46
47 --echo
48 --echo ## 3A. Test GR start with command when lower_case_table_names matches.
49 --echo
50 --source include/start_group_replication.inc
51
52 --let $assert_text= 'Assert server-1 and server-2 are ONLINE'
53 --let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members WHERE MEMBER_STATE=\"ONLINE\"]" = 2
54 --source include/assert.inc
55
56 --echo
57 --echo ## 3B. Test GR start on boot when lower_case_table_names matches.
58 --echo
59 --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 --lower_case_table_names=1
60 --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
61 --source include/restart_mysqld.inc
62
63 #Needed as we are not using rpl_restart_server.inc
64 --let $rpl_server_number= 2
65 --source include/rpl_reconnect.inc
66
67 --let $wait_condition= SELECT COUNT(*) = 2 FROM performance_schema.replication_group_members WHERE MEMBER_STATE="ONLINE"
68 --source include/wait_condition.inc
69
70 --echo
71 --echo ## 4. Cleanup.
72 --echo
73
74 --source include/group_replication_end.inc