summaryrefslogtreecommitdiff
path: root/mysql-test/r/derived.result
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-01-20 19:23:28 +0200
committerbell@sanja.is.com.ua <>2004-01-20 19:23:28 +0200
commit03d7217f7710fb607a59495513bfa1a13b2fc639 (patch)
tree58e31138eff605c80015c3b969fe8ff835561ec8 /mysql-test/r/derived.result
parent5b32ce5b0d68f608e9d3ab3c406333bf102dddc4 (diff)
parent2a55a7684f8d0ea098efb7468c4fbb70788b8b51 (diff)
downloadmariadb-git-03d7217f7710fb607a59495513bfa1a13b2fc639.tar.gz
Merge
Diffstat (limited to 'mysql-test/r/derived.result')
-rw-r--r--mysql-test/r/derived.result27
1 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index c0d2ce287db..d38601c331f 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -213,7 +213,7 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres
create table t1 (a int);
insert into t1 values (1),(2),(3);
update (select * from t1) as t1 set a = 5;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use
+ERROR HY000: The target table t1 of the UPDATE is not updatable.
delete from (select * from t1);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
insert into (select * from t1) values (5);
@@ -249,6 +249,31 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 2
3 UNION t1 ALL NULL NULL NULL NULL 2
drop table t1;
+CREATE TABLE `t1` (
+`N` int(11) unsigned NOT NULL default '0',
+`M` tinyint(1) default '0',
+) TYPE=MyISAM DEFAULT CHARSET=latin1;
+Warnings:
+Warning 1286 'TYPE=database_engine' is deprecated. Use 'ENGINE=database_engine' instead.
+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;
+N M
+1 2
+1 2
+1 2
+2 2
+2 2
+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, P2.N = 2;
+ERROR HY000: The target table P2 of the UPDATE is not updatable.
+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;
+N M
+3 0
+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;
+ERROR HY000: The target table P2 of the DELETE is not updatable.
+drop table t1;
CREATE TABLE t1 (
OBJECTID int(11) NOT NULL default '0',
SORTORDER int(11) NOT NULL auto_increment,