Add testcase for bug #12084.

This commit is contained in:
osku@127.(none) 2005-09-06 16:08:05 +03:00
parent 084e37b88c
commit 2c69c199a1
2 changed files with 27 additions and 0 deletions

View file

@ -2527,3 +2527,15 @@ SELECT * FROM t1;
id
1
DROP TABLE t2, t1;
CREATE TABLE t1
(
id INT PRIMARY KEY
) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2
(
id INT NOT NULL PRIMARY KEY,
b INT,
FOREIGN KEY (b) REFERENCES test.t1(id)
) ENGINE=InnoDB;
Got one of the listed errors
DROP TABLE t1;

View file

@ -1451,3 +1451,18 @@ TRUNCATE t1;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
DROP TABLE t2, t1;
-- Test that foreign keys in temporary tables are not accepted (bug #12084)
CREATE TABLE t1
(
id INT PRIMARY KEY
) ENGINE=InnoDB;
--error 1005,1005
CREATE TEMPORARY TABLE t2
(
id INT NOT NULL PRIMARY KEY,
b INT,
FOREIGN KEY (b) REFERENCES test.t1(id)
) ENGINE=InnoDB;
DROP TABLE t1;