Debian Codegraph @

mysql-test/suite/group_replication/r/gr_multi_primary_foreign_key_conflict.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6
7 ############################################################
8 # 1. Create a table on server1.
9 [connection server1]
10 CREATE TABLE t1 (a INT PRIMARY KEY);
11 CREATE TABLE t2 (b INT PRIMARY KEY);
12 CREATE TABLE t3 (c1 INT, c2 INT UNIQUE KEY, PRIMARY KEY(c1, c2), FOREIGN KEY(c1) REFERENCES t1(a), FOREIGN KEY(c2) REFERENCES t2(b));
13 INSERT INTO t1 VALUES (1);
14 INSERT INTO t2 VALUES (5);
15 include/rpl_sync.inc
16
17 ############################################################
18 # 2. Set a debug sync before broadcast message to group on
19 # connection server_1.
20 # Commit a transaction that will be block before broadcast.
21 [connection server_1]
22 SET @debug_save= @@GLOBAL.DEBUG;
23 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
24 BEGIN;
25 INSERT INTO t3 values(1,5);
26 COMMIT;
27
28 ############################################################
29 # 3. Wait until server_1 connection reaches the
30 # group_replication_before_message_broadcast debug sync point.
31 [connection server1]
32
33 ############################################################
34 # 4. Execute a transaction on server2, that will reach first
35 # certification, since server_1 is blocked before broadcast.
36 [connection server2]
37 UPDATE t1 SET a=2 WHERE a=1;
38
39 ############################################################
40 # 5. Signal the waiting thread on server_1 to resume.
41 [connection server1]
42 SET DEBUG_SYNC='now SIGNAL waiting';
43 SET @@GLOBAL.DEBUG= @debug_save;
44
45 ############################################################
46 # 6. It will end up in an error stating that it was aborted,
47 # since transactions are conflicting and server2 was
48 # ordered first.
49 [connection server2]
50 include/sync_slave_sql_with_master.inc
51 [connection server_1]
52 ERROR 40000: Plugin instructed the server to rollback the current transaction.
53
54 ############################################################
55 # 7. Assert that number of certified transactions are the
56 # expected ones.
57 [connection server1]
58 include/assert.inc [The value of Count_Transactions_Checked should be 7 after starting group replication]
59 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
60
61 ############################################################
62 # Checking the positive case in which there is no conflict.
63 ############################################################
64
65 INSERT INTO t1 VALUES (6);
66 INSERT INTO t1 VALUES (7);
67 INSERT INTO t2 VALUES (8);
68 include/rpl_sync.inc
69
70 ############################################################
71 # 1. Set a debug sync before broadcast message to group on
72 # connection server_1.
73 # Commit a transaction that will be block before broadcast.
74 [connection server_1]
75 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
76 BEGIN;
77 INSERT INTO t3 values(6,8);
78 COMMIT;
79
80 ############################################################
81 # 2. Wait until server_1 connection reaches the
82 # group_replication_before_message_broadcast debug sync point.
83 [connection server1]
84
85 ############################################################
86 # 3. Execute a transaction on server2, that will reach first
87 # certification, since server_1 is blocked before broadcast.
88 [connection server2]
89 UPDATE t1 SET a=9 WHERE a=7;
90 include/sync_slave_sql_with_master.inc
91
92 ############################################################
93 # 4. Signal the waiting thread on server_1 to resume.
94 [connection server1]
95 SET DEBUG_SYNC='now SIGNAL waiting';
96 SET @@GLOBAL.DEBUG= @debug_save;
97
98 ########################################################################
99 # 5. It will execute without error as the conflicting transactions have
100 # been removed.
101 [connection server_1]
102 include/rpl_sync.inc
103
104 ############################################################
105 # 6. Assert that number of certified transactions are the
106 # expected ones.
107 [connection server1]
108 include/assert.inc [Table t1 will contain row after the above execution]
109 include/assert.inc [Table t1 will contain row after the above execution]
110 include/assert.inc [Table t1 will contain row after the above execution]
111 include/assert.inc [Table t1 will contain row after the above execution]
112 include/assert.inc [Table t1 will contain row after the above execution]
113 include/assert.inc [Table t1 will contain row after the above execution]
114 include/assert.inc [Table t3 will contain 1 rows after the above execution]
115 include/assert.inc [Table t2 will contain 2 rows after the above execution]
116 include/assert.inc [Table t1 will contain 3 rows after the above execution]
117 include/assert.inc [The value of Count_Transactions_Checked should be 12 after starting group replication]
118 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
119
120 ############################################################
121 # Clean up.
122 DROP TABLE t3;
123 DROP TABLE t2;
124 DROP TABLE t1;
125 include/group_replication_end.inc