summaryrefslogtreecommitdiff
path: root/mysql-test/t/multi_update.test
blob: a1ebc64504f0f3f8c6b0a109e70e499c8257600c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12), index(id2));
create table t3(id3 int not null, t char(12), index(id3));
let $1 = 3;
while ($1)
 {
  let $2 = 3;
  eval insert into t1(t) values ('$1'); 
  while ($2)
   {
     eval insert into t2(id2,t) values ($1,'$2'); 
     eval insert into t3(id3,t) values ($1,'$2'); 
     dec $2; 
   }
  dec $1;
 }

delete t1.*,t2.* from t1,t2 where t1.id1 = t2.id2 and t1.id1 = 3;
delete t3 from t3 left join t1 on (id1=id3) where t1.id1 is null;
delete t2 from t1,t2,t3 where id1=id2 and id2=id3 and id1=2;
select * from t1;
select * from t2;
select * from t3;
delete t1,t2 from t1,t2 where 1;
drop table t1,t2,t3;