Debian Codegraph @

mysql-test/suite/engines/funcs/r/rpl_row_trig002.result

raw
1 include/master-slave.inc
2 [connection master]
3 connection master;
4 DROP TRIGGER test.t2_ai;
5 DROP TABLE IF EXISTS test.t1;
6 DROP TABLE IF EXISTS test.t2;
7 DROP TABLE IF EXISTS test.t3;
8 CREATE TABLE test.t2 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
9 CREATE TABLE test.t3 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
10 CREATE TABLE test.t1 (id INT,domain CHAR(30),PRIMARY KEY(id));
11 CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t3 ms, test.t1 d SET ms.value='No' WHERE ms.domain_id = (SELECT max(id) FROM test.t1 WHERE domain='example.com') AND ms.mailaccount_id IS NULL AND ms.program='spamfilter' AND ms.keey='scan_incoming'|
12 INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherwear.com'), (4, 'yahoo.com'),(5, 'example.com');
13 SELECT * FROM test.t1 ORDER BY id;
14 id domain
15 1 example.com
16 2 mysql.com
17 3 earthmotherwear.com
18 4 yahoo.com
19 5 example.com
20 connection slave;
21 SELECT * FROM test.t1 ORDER BY id;
22 id domain
23 1 example.com
24 2 mysql.com
25 3 earthmotherwear.com
26 4 yahoo.com
27 5 example.com
28 connection master;
29 INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming');
30 INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
31 INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
32 select * from test.t2;
33 value domain_id mailaccount_id program keey
34 Yes 1 NULL spamfilter scan_incoming
35 select * from test.t3;
36 value domain_id mailaccount_id program keey
37 No 5 NULL spamfilter scan_incoming
38 Yes 1 NULL spamfilter scan_incoming
39 connection slave;
40 select * from test.t2;
41 value domain_id mailaccount_id program keey
42 Yes 1 NULL spamfilter scan_incoming
43 select * from test.t3;
44 value domain_id mailaccount_id program keey
45 No 5 NULL spamfilter scan_incoming
46 Yes 1 NULL spamfilter scan_incoming
47 connection master;
48 DELETE FROM test.t1 WHERE id = 1;
49 SELECT * FROM test.t1 ORDER BY id;
50 id domain
51 2 mysql.com
52 3 earthmotherwear.com
53 4 yahoo.com
54 5 example.com
55 connection master;
56 SELECT * FROM test.t1 ORDER BY id;
57 id domain
58 2 mysql.com
59 3 earthmotherwear.com
60 4 yahoo.com
61 5 example.com
62 connection slave;
63 SELECT * FROM test.t1 ORDER BY id;
64 id domain
65 2 mysql.com
66 3 earthmotherwear.com
67 4 yahoo.com
68 5 example.com
69 connection master;
70 DROP TRIGGER test.t2_ai;
71 DROP TABLE test.t1;
72 DROP TABLE test.t2;
73 DROP TABLE test.t3;
74 connection slave;
75 include/rpl_end.inc