diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2004-02-19 19:43:46 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2004-02-19 19:43:46 +0200 |
commit | e022b27860309684497de6e0e78135c1139325e4 (patch) | |
tree | a5d6697daf9ae5d579d058632d73c80686482c12 /mysql-test/t/multi_update.test | |
parent | 6c1795ee098cb6285610425b9b30ee6ab1caf34b (diff) | |
download | mariadb-git-e022b27860309684497de6e0e78135c1139325e4.tar.gz |
Fix for a bug #2799.
Multi-table delete's with tables having foreign key constraints
did not return the error.
Also added tests for multi-table updates.
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r-- | mysql-test/t/multi_update.test | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 56dcf9a03a9..449d58855d9 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -302,4 +302,16 @@ delete t1, t2 from t2,t1 where t1.id1=t2.id2 and 0=1; drop table t1,t2; - +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb; +insert into `t1`values ( 1 ) ; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb; +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` )) type = innodb; +insert into `t3`values ( 1 ) ; +--error 1217 +delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +--error 1217 +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 1109 +update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +drop table t3,t2,t1; |