~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
 
8
CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
 
9
SET FOREIGN_KEY_CHECKS=0;
 
10
INSERT INTO t1 VALUES (10);
 
11
INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
 
12
INSERT INTO t2 VALUES (5,0);
 
13
INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
 
14
SET FOREIGN_KEY_CHECKS=1;
 
15
SELECT * FROM t1 ORDER BY a;
 
16
a
 
17
10
 
18
11
 
19
12
 
20
13
 
21
SELECT * FROM t2 ORDER BY b;
 
22
b       c
 
23
5       0
 
24
6       11
 
25
SELECT * FROM t1 ORDER BY a;
 
26
a
 
27
10
 
28
11
 
29
12
 
30
13
 
31
SELECT * FROM t2 ORDER BY b;
 
32
b       c
 
33
5       0
 
34
6       11
 
35
SET TIMESTAMP=1000000000;
 
36
CREATE TABLE t3 ( a INT UNIQUE );
 
37
SET FOREIGN_KEY_CHECKS=0;
 
38
INSERT INTO t3 VALUES (1),(1);
 
39
Got one of the listed errors
 
40
SET FOREIGN_KEY_CHECKS=0;
 
41
DROP TABLE IF EXISTS t1,t2,t3;
 
42
SET FOREIGN_KEY_CHECKS=1;
 
43
create table t1 (b int primary key) engine = INNODB;
 
44
create table t2 (a int primary key, b int, foreign key (b) references t1(b))
 
45
engine = INNODB;
 
46
insert into t1 set b=1;
 
47
insert into t2 set a=1, b=1;
 
48
set foreign_key_checks=0;
 
49
set @@session.binlog_format=row;
 
50
delete from t1;
 
51
must sync w/o a problem (could not with the buggy code)
 
52
select count(*) from t1 /* must be zero */;
 
53
count(*)
 
54
0
 
55
drop table t2,t1;