Debian Codegraph @

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

raw
1 ################################################################################
2 # BUG#21180035 - ADD SUPPORT TO SKIP GTIDS ON GROUP REPLICATION
3 #
4 # CASE 1 - Single node testing
5 #
6 # Test:
7 # 0) The test requires one server: M1.
8 # 1) Bootstrap start a group on M1.
9 # 2) On M1 execute a transaction with GTID_NEXT=UUID_GROUP:2. M1 will have:
10 # GTID EXECUTED = UUID_GROUP:1-2.
11 # 3) On M1 SET GTID_NEXT='AUTOMATIC'.
12 # 4) On M1 execute a transaction, it will have:
13 # GTID EXECUTED = UUID_GROUP:1-3.
14 # 5) Verify sequence of events in binlog on M1.
15 # 6) Clean up.
16 ################################################################################
17
18 --let $group_replication_group_name= 32e14712-01d2-11e6-a992-02420ef39c5b
19 --source include/have_group_replication_plugin.inc
20 --let $rpl_skip_group_replication_start= 1
21 --source include/group_replication.inc
22
23 # The sequence of events that make up a View Change
24 --let $vcle_seq= Gtid # Query/BEGIN # View_change # Query/COMMIT
25
26 --let $rpl_connection_name= server1
27 --source include/rpl_connection.inc
28 SET SESSION sql_log_bin= 0;
29 --source include/gtid_utils.inc
30 SET SESSION sql_log_bin= 1;
31
32 --source include/start_and_bootstrap_group_replication.inc
33 --eval SET GTID_NEXT= "$group_replication_group_name:2"
34 CREATE TABLE t1 (i INT PRIMARY KEY);
35 SET GTID_NEXT='AUTOMATIC';
36
37 --let $assert_text= GTID_EXECUTED must contain two transactions, one from view change and other being the create table.
38 --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED,"$group_replication_group_name:1-2")
39 --source include/assert.inc
40
41 INSERT INTO t1 VALUES(1);
42
43 --let $assert_text= GTID_EXECUTED must contain three transactions, the new one from the insert.
44 --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED,"$group_replication_group_name:1-3")
45 --source include/assert.inc
46
47 # View change (s1) # Create table # Insert table
48 --let $event_sequence= $vcle_seq # Gtid # !Q(CREATE.*) # Gtid # !Begin # Table_map # Write_rows # !Commit
49 --source include/assert_binlog_events.inc
50
51 # Cleanup
52
53 DROP TABLE t1;
54 --let $rpl_connection_name= server1
55 --source include/rpl_connection.inc
56 SET SESSION sql_log_bin= 0;
57 --source include/gtid_utils_end.inc
58 SET SESSION sql_log_bin= 1;
59 --source include/group_replication_end.inc