Debian Codegraph @

mysql-test/suite/group_replication/r/gr_multiple_trigger.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 #1. Create tables and a trigger t1_b on master.
8 [connection server1]
9 CREATE TABLE t1 (a INT PRIMARY KEY);
10 CREATE TABLE t2 (a INT PRIMARY KEY, b INT DEFAULT 0);
11 create trigger t1_b
12 after insert on t1
13 for each row
14 BEGIN
15 INSERT INTO t2 VALUES (New.a, @value1);
16 END|
17 include/rpl_sync.inc
18
19 #2. Check that action_order attribute of trigger t1_b is same on both servers.
20 include/assert.inc [action_order for trigger t1_b must be 1.]
21 [connection server2]
22 include/assert.inc [action_order for trigger t1_b must be 1.]
23 [connection server1]
24
25 #3. Create another trigger t1_a on t1 for same action event and timing.
26 create trigger t1_a
27 after insert on t1
28 for each row PRECEDES t1_b
29 BEGIN
30 SET @value1:= New.a * 2;
31 END|
32 include/rpl_sync.inc
33
34 #4. Check that CREATED, ACTION_ORDER attributes are same on both servers.
35 include/assert.inc [action_order for trigger t1_a must be 1.]
36 include/assert.inc [action_order for trigger t1_b must be 2.]
37 [connection server2]
38 include/assert.inc [action_order for trigger t1_a must be 1.]
39 include/assert.inc [action_order for trigger t1_b must be 2.]
40 include/assert.inc [Created attribute for a trigger must be same on both the servers]
41
42 #5. Insert some data to the table on master.
43 [connection server1]
44 INSERT INTO t1 (a) values (1),(2);
45 DROP TRIGGER test.t1_b;
46 INSERT INTO t1 (a) values (3);
47
48 #6. Ensure that data is consistent on both the servers.
49 include/rpl_sync.inc
50 include/diff_tables.inc [server1:t1,server2:t1]
51 include/diff_tables.inc [server1:t2,server2:t2]
52
53 #7. Clean-up
54 DROP TRIGGER test.t1_a;
55 DROP TABLE t1;
56 DROP TABLE t2;
57 include/group_replication_end.inc