~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_trig004.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
# Change: Added error, sleep and comments (ndb)    #
 
11
####################################################
 
12
 
 
13
# Begin clean up test section
 
14
connection master;
 
15
--disable_warnings
 
16
--error 0,1360
 
17
DROP TRIGGER test.t1_bi_t2;
 
18
DROP TABLE IF EXISTS test.t1;
 
19
DROP TABLE IF EXISTS test.t2;
 
20
 
 
21
 
 
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;
 
24
 
 
25
 
 
26
delimiter //;
 
27
CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
 
28
delimiter ;//
 
29
 
 
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);
 
34
 
 
35
#show binlog events; 
 
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
 
40
sleep 10;
 
41
sync_slave_with_master;
 
42
connection slave;
 
43
select * from test.t1;
 
44
select * from test.t2;
 
45
 
 
46
connection master;
 
47
 
 
48
DROP TRIGGER test.t1_bi_t2;
 
49
DROP TABLE test.t1;
 
50
DROP TABLE test.t2;
 
51
 
 
52
sync_slave_with_master;
 
53
# End of 5.0 test case