| 1 |
################################################################################ |
| 2 |
# This test will create in parallel, in the same member, two transactions |
| 3 |
# with two different clients. |
| 4 |
# |
| 5 |
# The success of this test is determined by its termination. Any failure |
| 6 |
# in the parallelism of a transaction shall hang this test. |
| 7 |
# |
| 8 |
# Test: |
| 9 |
# 0. The test requires one server. |
| 10 |
# 1. With member ONLINE. Create a table t1. |
| 11 |
# 2. Creating several entries in parallel in the same table. |
| 12 |
# 3. Test if one succeeded creating all entries in the test. |
| 13 |
# 4. Clean up. |
| 14 |
################################################################################ |
| 15 |
|
| 16 |
--source include/have_group_replication_plugin.inc |
| 17 |
--source include/group_replication.inc |
| 18 |
|
| 19 |
CREATE TABLE t1 (a INT AUTO_INCREMENT, PRIMARY KEY (a), b int) engine=InnoDB; |
| 20 |
--source include/rpl_sync.inc |
| 21 |
|
| 22 |
--connection server1 |
| 23 |
|
| 24 |
--echo # |
| 25 |
--echo # Creating several entries in parallel in the same table |
| 26 |
--echo # |
| 27 |
|
| 28 |
--disable_query_log |
| 29 |
--let $entries=50 |
| 30 |
while($entries > 0) |
| 31 |
{ |
| 32 |
--connection server1 |
| 33 |
--send INSERT INTO t1 (b) VALUES(1) |
| 34 |
|
| 35 |
--connection master |
| 36 |
--send INSERT INTO t1 (b) VALUES(2) |
| 37 |
|
| 38 |
--connection server1 |
| 39 |
--reap |
| 40 |
|
| 41 |
--connection master |
| 42 |
--reap |
| 43 |
|
| 44 |
--dec $entries |
| 45 |
} |
| 46 |
--enable_query_log |
| 47 |
|
| 48 |
--echo # |
| 49 |
--echo # Test if one succeeded creating all entries in the test. |
| 50 |
--echo # |
| 51 |
--let $assert_text= Table t1 must have 100 entries |
| 52 |
--let $assert_cond= "[SELECT COUNT(*) AS count FROM t1, count, 1]" = "100" |
| 53 |
--source include/assert.inc |
| 54 |
|
| 55 |
--connection server1 |
| 56 |
DROP TABLE t1; |
| 57 |
|
| 58 |
--source include/group_replication_end.inc |
| 59 |
|