1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Aug/14/2005 #
4
# Updated: 08/29/2005 added save master pos and sync with master #
5
#############################################################################
6
# TEST: Taken and modified from BUG#12048 After Insert updates replication #
7
#############################################################################
10
-- source include/have_binlog_format_row.inc
11
-- source include/master-slave.inc
14
#-- disable_result_log
16
# Begin clean up test section
20
DROP TRIGGER test.t2_ai;
21
DROP TABLE IF EXISTS test.t1;
22
DROP TABLE IF EXISTS test.t2;
23
DROP TABLE IF EXISTS test.t3;
26
# test section 1, Taken from bug #12408
28
CREATE TABLE test.t2 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
30
CREATE TABLE test.t3 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
32
CREATE TABLE test.t1 (id INT,domain CHAR(30),PRIMARY KEY(id));
35
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'|
38
INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherwear.com'), (4, 'yahoo.com'),(5, 'example.com');
40
SELECT * FROM test.t1 ORDER BY id;
45
SELECT * FROM test.t1 ORDER BY id;
48
INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming');
49
INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
50
INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
52
select * from test.t2;
53
select * from test.t3;
57
select * from test.t2;
58
select * from test.t3;
61
DELETE FROM test.t1 WHERE id = 1;
63
SELECT * FROM test.t1 ORDER BY id;
65
SELECT * FROM test.t1 ORDER BY id;
69
SELECT * FROM test.t1 ORDER BY id;
74
DROP TRIGGER test.t2_ai;
78
sync_slave_with_master;
80
# End of 5.0 test case