mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge rurik.mysql.com:/home/igor/mysql-4.0
into rurik.mysql.com:/home/igor/dev/mysql-4.0-1
This commit is contained in:
@ -327,3 +327,26 @@ select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and
|
||||
a b a b
|
||||
2 2 NULL NULL
|
||||
drop table t1,t2;
|
||||
drop table if exists t1, t2;
|
||||
create table t1(id1 smallint(5), field char(5));
|
||||
create table t2(id2 smallint(5), field char(5));
|
||||
insert into t1 values (1, 'a'), (2, 'aa');
|
||||
insert into t2 values (1, 'b'), (2, 'bb');
|
||||
select * from t1;
|
||||
id1 field
|
||||
1 a
|
||||
2 aa
|
||||
select * from t2;
|
||||
id2 field
|
||||
1 b
|
||||
2 bb
|
||||
update t2 inner join t1 on t1.id1=t2.id2
|
||||
set t2.field=t1.field
|
||||
where 0=1;
|
||||
update t2, t1 set t2.field=t1.field
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
|
||||
where 0=1;
|
||||
delete t1, t2 from t2,t1
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
drop table t1,t2;
|
||||
|
@ -267,3 +267,29 @@ insert into t2 values (1,1), (3,1);
|
||||
update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
drop table t1,t2;
|
||||
|
||||
# Test multi-update and multi-delete with impossible where
|
||||
|
||||
drop table if exists t1, t2;
|
||||
create table t1(id1 smallint(5), field char(5));
|
||||
create table t2(id2 smallint(5), field char(5));
|
||||
|
||||
insert into t1 values (1, 'a'), (2, 'aa');
|
||||
insert into t2 values (1, 'b'), (2, 'bb');
|
||||
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
|
||||
update t2 inner join t1 on t1.id1=t2.id2
|
||||
set t2.field=t1.field
|
||||
where 0=1;
|
||||
update t2, t1 set t2.field=t1.field
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
|
||||
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
|
||||
where 0=1;
|
||||
delete t1, t2 from t2,t1
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
|
Reference in New Issue
Block a user