summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-11-02 15:52:40 +0200
committerunknown <bell@sanja.is.com.ua>2003-11-02 15:52:40 +0200
commita0aceafb86e57549dd38ef2e745ade3b6e7057cf (patch)
tree40bca0c30623658294a6358beb5ffca6a128a6a6 /mysql-test
parent52600e88c051a79126cc9083c955a31668fd75a3 (diff)
parent87ce2aa098dcc1a8f3511ff07260638c83bf62c0 (diff)
downloadmariadb-git-a0aceafb86e57549dd38ef2e745ade3b6e7057cf.tar.gz
merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/subselect.result11
-rw-r--r--mysql-test/t/subselect.test18
2 files changed, 26 insertions, 3 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index db0c3184120..605e7eab4e1 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1349,7 +1349,7 @@ create table t2 (s1 int);
insert into t1 values (1);
insert into t2 values (1);
update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A);
-ERROR 42S02: Unknown table 'x' in field list
+ERROR 42S22: Unknown column 'x.s1' in 'field list'
DROP TABLE t1, t2;
create table t1 (a int) type=innodb;
create table t2 (a int) type=innodb;
@@ -1514,3 +1514,12 @@ phone code
89356874041 NULL
95895001874 NULL
drop table t1, t2;
+create table t1 (s1 int);
+create table t2 (s1 int);
+select * from t1 where (select count(*) from t2 where t1.s2) = 1;
+ERROR 42S22: Unknown column 't1.s2' in 'where clause'
+select * from t1 where (select count(*) from t2 group by t1.s2) = 1;
+ERROR 42S22: Unknown column 't1.s2' in 'group statement'
+select count(*) from t2 group by t1.s2;
+ERROR 42S02: Unknown table 't1' in group statement
+drop table t1, t2;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 576e96c5c18..a98a8fd632a 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -693,7 +693,7 @@ INSERT INTO t1 VALUES (1);
UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i));
-- error 1111
UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i));
--- error 1109
+-- error 1054
UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t);
drop table t1;
@@ -887,7 +887,7 @@ create table t1 (s1 int);
create table t2 (s1 int);
insert into t1 values (1);
insert into t2 values (1);
--- error 1109
+-- error 1054
update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A);
DROP TABLE t1, t2;
@@ -1030,3 +1030,17 @@ CREATE TABLE t2 (code char(5) NOT NULL default '',UNIQUE KEY code (code)) TYPE=M
INSERT INTO t2 VALUES ('1'),('1226'),('1245'),('1862'),('18623'),('1874'),('1967'),('6');
select c.number as phone,(select p.code from t2 p where c.number like concat(p.code, '%') order by length(p.code) desc limit 1) as code from t1 c;
drop table t1, t2;
+
+#
+# unresolved field error
+#
+create table t1 (s1 int);
+create table t2 (s1 int);
+-- error 1054
+select * from t1 where (select count(*) from t2 where t1.s2) = 1;
+-- error 1054
+select * from t1 where (select count(*) from t2 group by t1.s2) = 1;
+-- error 1109
+select count(*) from t2 group by t1.s2;
+drop table t1, t2;
+