summaryrefslogtreecommitdiff
path: root/mysql-test/t/multi_update.test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2004-05-04 23:04:05 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2004-05-04 23:04:05 +0300
commit21c79c245a8e6ff856150dc12e2d5eb602f8a3f4 (patch)
treeab3b788364417bddf4ae2820a5b6a3f7294f4e57 /mysql-test/t/multi_update.test
parent318b07e80a1aefa62274d4545f7a5b4ea59c02ea (diff)
downloadmariadb-git-21c79c245a8e6ff856150dc12e2d5eb602f8a3f4.tar.gz
Fix for a multi table updates when one of the tables is not updated
but used in a nested query.
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r--mysql-test/t/multi_update.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 8b6941c4a94..36854551a7f 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -260,6 +260,10 @@ update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t2.a=t1
select * from t1;
select * from t2;
+# test for non-updating table which is also used in sub-select
+
+update t1,t2 set t1.b=t2.b, t1.a=t2.a where t1.a=t2.a and not exists (select * from t2 where t2.a > 10);
+
drop table t1,t2;
CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('A',1,1,22,3.2,'R','R','BASE2',0.24,NULL);