mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 4.1 to 5.0.
BitKeeper/etc/logging_ok: auto-union client/mysql.cc: Auto merged configure.in: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/mi_check.c: Auto merged mysql-test/r/insert.result: Auto merged mysql-test/r/join_outer.result: Auto merged mysql-test/r/multi_update.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/insert.test: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/query_cache.test: Auto merged sql/ha_innodb.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/item_timefunc.cc: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/records.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_rename.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged
This commit is contained in:
@ -60,8 +60,8 @@ delete from t1, t2, t3 using t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3
|
||||
select count(*) from t1 where id1;
|
||||
select count(*) from t2 where id2;
|
||||
select count(*) from t3 where id3;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
create table t1(id1 int not null primary key, t varchar(100)) pack_keys = 1;
|
||||
create table t2(id2 int not null, t varchar(100), index(id2)) pack_keys = 1;
|
||||
disable_query_log;
|
||||
@ -276,6 +276,41 @@ 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
|
||||
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 reuse of same table
|
||||
#
|
||||
|
||||
create table t1 (a int not null auto_increment primary key, b int not null);
|
||||
insert into t1 (b) values (1),(2),(3),(4);
|
||||
update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# Test multi-update and multi-delete with impossible where
|
||||
|
||||
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;
|
||||
|
||||
|
||||
#
|
||||
# Test for bug #1820.
|
||||
#
|
||||
|
Reference in New Issue
Block a user