Debian Codegraph @

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

raw
1 ################################################################################
2 # Test to check for the behavior of the auto increment field of the tables
3 # when inserting rows on them parallely on the different members of the Group.
4 #
5 # Test:
6 # 0. The test requires two servers: M1 and M2.
7 # 1. Create a table t1 with a INT auto_increment column and insert data 1 in
8 # GROUP.
9 # 2. Perform 49 parallel inserts on M1 and M2.
10 # 3. Diff tables t1 in both M1 and M2. It shouldn't be different.
11 # 4. Assert check that table t1 contains 99 rows.
12 # 5. Clean up.
13 ################################################################################
14
15 --source include/have_group_replication_plugin.inc
16 --source include/group_replication.inc
17
18 CREATE TABLE t1 (a INT AUTO_INCREMENT, PRIMARY KEY (a)) engine=innodb;
19 INSERT INTO t1 VALUES(1);
20 --source include/rpl_sync.inc
21
22 # Perform 49 insert to get parallely to better test the auto_increment
23 # behavior.
24 --let $temp=50
25 while($temp > 1)
26 {
27 --connection server1
28 --send INSERT INTO t1 VALUES(NULL)
29
30 --connection server2
31 --send INSERT INTO t1 VALUES(NULL)
32
33 --connection server1
34 --reap
35
36 --connection server2
37 --reap
38
39 --dec $temp
40 }
41
42 # sync server1, server2
43 --let $rpl_connection_name= server1
44 --source include/rpl_connection.inc
45 --let $wait_condition= SELECT COUNT(a)=99 FROM t1
46 --source include/wait_condition.inc
47
48 --let $rpl_connection_name= server2
49 --source include/rpl_connection.inc
50 --let $wait_condition= SELECT COUNT(a)=99 FROM t1
51 --source include/wait_condition.inc
52
53 --source include/rpl_sync.inc
54
55 --let $diff_tables= server1:t1, server2:t1
56 --source include/diff_tables.inc
57
58 --connection server1
59 DROP TABLE t1;
60
61 --source include/group_replication_end.inc