summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-01-20 19:23:28 +0200
committerunknown <bell@sanja.is.com.ua>2004-01-20 19:23:28 +0200
commitc3cf3d28209702a521a736daa6f797c2407db715 (patch)
tree58e31138eff605c80015c3b969fe8ff835561ec8 /mysql-test/t/derived.test
parentfe21bfb60aaf56796350d3622f906b87e20d5ce8 (diff)
parent7a1a5cd2d828d67120d10eb623c6c5bd83733260 (diff)
downloadmariadb-git-c3cf3d28209702a521a736daa6f797c2407db715.tar.gz
Merge
sql/sql_parse.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/derived.result: SCCS merged mysql-test/t/derived.test: e merge
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r--mysql-test/t/derived.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 8de95b4b600..154fc4b3834 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -116,7 +116,7 @@ select mail_id, if(folder.f_description!='', folder.f_description, folder.f_nam
#
create table t1 (a int);
insert into t1 values (1),(2),(3);
--- error 1149
+-- error 1287
update (select * from t1) as t1 set a = 5;
-- error 1064
delete from (select * from t1);
@@ -142,6 +142,24 @@ drop table t1;
#
+# multi-update & multi-delete with derived tables
+#
+CREATE TABLE `t1` (
+ `N` int(11) unsigned NOT NULL default '0',
+ `M` tinyint(1) default '0',
+) TYPE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
+UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
+select * from t1;
+-- error 1287
+UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
+delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
+select * from t1;
+-- error 1287
+delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
+drop table t1;
+
+#
# correct lex->current_select
#
CREATE TABLE t1 (