| 1 |
############################################################################# |
| 2 |
# Original Author: JBM # |
| 3 |
# Original Date: Aug/09/2005 # |
| 4 |
############################################################################# |
| 5 |
# TEST: Use after insert and before inset triggers and stored procdures to # |
| 6 |
# Update and insert data # |
| 7 |
############################################################################# |
| 8 |
# Change Auth: JBM # |
| 9 |
# Date: 2006-02-14 # |
| 10 |
#################################################### |
| 11 |
|
| 12 |
# Begin clean up test section |
| 13 |
connection master; |
| 14 |
--disable_warnings |
| 15 |
--error 0,1360 |
| 16 |
DROP TRIGGER test.t1_bi_t2; |
| 17 |
DROP TABLE IF EXISTS test.t1; |
| 18 |
DROP TABLE IF EXISTS test.t2; |
| 19 |
|
| 20 |
|
| 21 |
eval CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=$engine_type; |
| 22 |
eval CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=$engine_type; |
| 23 |
|
| 24 |
|
| 25 |
delimiter //; |
| 26 |
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)// |
| 27 |
delimiter ;// |
| 28 |
|
| 29 |
INSERT INTO test.t2 VALUES (1, 0.0); |
| 30 |
--error ER_DUP_ENTRY |
| 31 |
INSERT INTO test.t2 VALUES (1, 0.0); |
| 32 |
|
| 33 |
#show binlog events; |
| 34 |
select * from test.t1; |
| 35 |
select * from test.t2; |
| 36 |
sync_slave_with_master; |
| 37 |
connection slave; |
| 38 |
select * from test.t1; |
| 39 |
select * from test.t2; |
| 40 |
|
| 41 |
connection master; |
| 42 |
|
| 43 |
DROP TRIGGER test.t1_bi_t2; |
| 44 |
DROP TABLE test.t1; |
| 45 |
DROP TABLE test.t2; |
| 46 |
|
| 47 |
sync_slave_with_master; |
| 48 |
# End of 5.0 test case |