Skip to content

Commit 65b4d74

Browse files
committed
Merge the test innodb.innodb_misc1 into innodb.innodb.
1 parent d26b9f6 commit 65b4d74

File tree

5 files changed

+55
-2166
lines changed

5 files changed

+55
-2166
lines changed

mysql-test/suite/innodb/r/innodb.result

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,17 +2455,30 @@ drop table t1,t2;
24552455
CREATE TABLE t1 (
24562456
id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
24572457
) ENGINE=InnoDB;
2458+
CREATE TABLE t2 (
2459+
id INTEGER NOT NULL,
2460+
FOREIGN KEY (id) REFERENCES t1 (id)
2461+
) ENGINE=InnoDB;
24582462
INSERT INTO t1 (id) VALUES (NULL);
24592463
SELECT * FROM t1;
24602464
id
24612465
1
24622466
TRUNCATE t1;
2467+
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`))
24632468
INSERT INTO t1 (id) VALUES (NULL);
24642469
SELECT * FROM t1;
24652470
id
24662471
1
2472+
2
24672473
DELETE FROM t1;
24682474
TRUNCATE t1;
2475+
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`))
2476+
INSERT INTO t1 (id) VALUES (NULL);
2477+
SELECT * FROM t1;
2478+
id
2479+
3
2480+
DROP TABLE t2;
2481+
TRUNCATE t1;
24692482
INSERT INTO t1 (id) VALUES (NULL);
24702483
SELECT * FROM t1;
24712484
id
@@ -2481,7 +2494,7 @@ id INT NOT NULL PRIMARY KEY,
24812494
b INT,
24822495
FOREIGN KEY (b) REFERENCES test.t1(id)
24832496
) ENGINE=InnoDB;
2484-
Got one of the listed errors
2497+
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
24852498
DROP TABLE t1;
24862499
create table t1 (col1 varchar(2000), index (col1(767)))
24872500
character set = latin1 engine = innodb;
@@ -2574,7 +2587,7 @@ INSERT INTO t2 VALUES(1);
25742587
DELETE FROM t1 WHERE id = 1;
25752588
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
25762589
DROP TABLE t1;
2577-
Got one of the listed errors
2590+
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
25782591
SET FOREIGN_KEY_CHECKS=0;
25792592
DROP TABLE t1;
25802593
SET FOREIGN_KEY_CHECKS=1;
@@ -3089,8 +3102,8 @@ a BIGINT(20) NOT NULL,
30893102
b VARCHAR(128) NOT NULL,
30903103
c TEXT NOT NULL,
30913104
PRIMARY KEY (a,b),
3092-
KEY idx_t2_b_c (b,c(200)),
3093-
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
3105+
KEY idx_t2_b_c (b,c(100)),
3106+
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
30943107
ON DELETE CASCADE
30953108
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
30963109
INSERT INTO t1 VALUES (1);

0 commit comments

Comments
 (0)