Debian Codegraph @

mysql-test/suite/innodb/r/foreign_sql_mode,INPLACE,NON-STRICT.rdiff

raw
1 --- foreign_sql_mode.result
2 +++ foreign_sql_mode,INPLACE,NON-STRICT.rdiff
3 @@ -3,14 +3,14 @@
4 CREATE TABLE t1(f1 INT, f2 INT, PRIMARY KEY(f1), KEY(f2))ENGINE=InnoDB;
5 CREATE TABLE t2(f1 INT, FOREIGN KEY(f1) REFERENCES t1(f2) ON UPDATE CASCADE)ENGINE=InnoDB;
6 ALTER TABLE t2 MODIFY COLUMN f1 INT NOT NULL;
7 -ERROR HY000: Column 'f1' cannot be NOT NULL: needed in a foreign key constraint 't2_ibfk_1' SET NULL
8 INSERT INTO t1 VALUES(1, 1);
9 INSERT INTO t2 VALUES(1);
10 UPDATE t1 SET f2= NULL;
11 +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f1`) REFERENCES `t1` (`f2`) ON UPDATE CASCADE)
12 DELETE FROM t2;
13 SELECT * FROM t1;
14 f1 f2
15 -1 NULL
16 +1 1
17 UPDATE t1 SET f2 = NULL;
18 SELECT * FROM t1;
19 f1 f2
20 @@ -40,11 +40,10 @@
21 FOREIGN KEY(f1) REFERENCES `t#1`(f2)
22 ON UPDATE CASCADE)ENGINE=InnoDB;
23 ALTER TABLE `t#1` MODIFY COLUMN f2 INT;
24 -ERROR HY000: Cannot change column 'f2': used in a foreign key constraint 't#2_ibfk_1' of table 'test.t#2'
25 INSERT INTO `t#1` VALUES(1, 1);
26 INSERT INTO `t#2` VALUES(1);
27 UPDATE `t#1` SET f2= NULL;
28 -ERROR 23000: Column 'f2' cannot be null
29 +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t#2`, CONSTRAINT `t#2_ibfk_1` FOREIGN KEY (`f1`) REFERENCES `t#1` (`f2`) ON UPDATE CASCADE)
30 DELETE FROM `t#2`;
31 SELECT * FROM `t#1`;
32 f1 f2
33 @@ -60,6 +59,5 @@
34 PRIMARY KEY(f1, f2),
35 FOREIGN KEY(f2, f3) REFERENCES t1(f2, f1)
36 ON UPDATE CASCADE)ENGINE=InnoDB;
37 -ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
38 DROP TABLE IF EXISTS t2;
39 DROP TABLE IF EXISTS t1;