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 #############################################################################
10 # Change: Added error, sleep and comments (ndb) #
11 ####################################################
13 # Begin clean up test section
17 DROP TRIGGER test.t1_bi_t2;
18 DROP TABLE IF EXISTS test.t1;
19 DROP TABLE IF EXISTS test.t2;
22 eval CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
23 eval CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
27 CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
30 INSERT INTO test.t2 VALUES (1, 0.0);
31 # Expect duplicate error 1022 == ndb
32 --error 1022, ER_DUP_ENTRY
33 INSERT INTO test.t2 VALUES (1, 0.0);
36 select * from test.t1;
37 select * from test.t2;
38 # Have to sleep for a few seconds to allow
39 # NDB injector thread to populate binlog
41 sync_slave_with_master;
43 select * from test.t1;
44 select * from test.t2;
48 DROP TRIGGER test.t1_bi_t2;
52 sync_slave_with_master;
53 # End of 5.0 test case