mirror of
https://github.com/MariaDB/server.git
synced 2025-11-18 07:48:43 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg13407
This commit is contained in:
@@ -978,9 +978,9 @@ create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` )
|
||||
insert into `t2`values ( 1 ) ;
|
||||
create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
|
||||
insert into `t3`values ( 1 ) ;
|
||||
--error 1217
|
||||
--error 1451
|
||||
delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
|
||||
--error 1217
|
||||
--error 1451
|
||||
update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
|
||||
--error 1054
|
||||
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
|
||||
@@ -996,7 +996,7 @@ create table t1(
|
||||
foreign key(pid) references t1(id) on delete cascade) engine=innodb;
|
||||
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
|
||||
(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
|
||||
-- error 1217
|
||||
-- error 1451
|
||||
delete from t1 where id=0;
|
||||
delete from t1 where id=15;
|
||||
delete from t1 where id=0;
|
||||
@@ -1528,3 +1528,39 @@ create table t4 (col1 text, index(col1(768)))
|
||||
--error 1005
|
||||
create table t5 (col1 blob, index(col1(768)))
|
||||
character set = latin1 engine = innodb;
|
||||
|
||||
#
|
||||
# Test improved foreign key error messages (bug #3443)
|
||||
#
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT PRIMARY KEY
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t2
|
||||
(
|
||||
v INT,
|
||||
CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--error 1452
|
||||
INSERT INTO t2 VALUES(2);
|
||||
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
|
||||
--error 1451
|
||||
DELETE FROM t1 WHERE id = 1;
|
||||
|
||||
--error 1217
|
||||
DROP TABLE t1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
DROP TABLE t1;
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
|
||||
--error 1452
|
||||
INSERT INTO t2 VALUES(3);
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
Reference in New Issue
Block a user