| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
DROP TRIGGER test.t1_bi_t2; |
| 5 |
DROP TABLE IF EXISTS test.t1; |
| 6 |
DROP TABLE IF EXISTS test.t2; |
| 7 |
CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=INNODB; |
| 8 |
CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=INNODB; |
| 9 |
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)// |
| 10 |
INSERT INTO test.t2 VALUES (1, 0.0); |
| 11 |
INSERT INTO test.t2 VALUES (1, 0.0); |
| 12 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 13 |
select * from test.t1; |
| 14 |
n d |
| 15 |
1 1.234 |
| 16 |
select * from test.t2; |
| 17 |
n f |
| 18 |
1 0 |
| 19 |
connection slave; |
| 20 |
connection slave; |
| 21 |
select * from test.t1; |
| 22 |
n d |
| 23 |
1 1.234 |
| 24 |
select * from test.t2; |
| 25 |
n f |
| 26 |
1 0 |
| 27 |
connection master; |
| 28 |
DROP TRIGGER test.t1_bi_t2; |
| 29 |
DROP TABLE test.t1; |
| 30 |
DROP TABLE test.t2; |
| 31 |
connection slave; |
| 32 |
include/rpl_end.inc |