summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-06-10 21:33:15 +0300
committerunknown <bell@sanja.is.com.ua>2004-06-10 21:33:15 +0300
commitd9b81f3a084c362d9948504b59149bade9eb4229 (patch)
treef035e112c3312d9754f9971c9d02ca260d43d40e /mysql-test/r
parentf9ec1ff25a7c645b21973a347126503e4247e020 (diff)
downloadmariadb-git-d9b81f3a084c362d9948504b59149bade9eb4229.tar.gz
EXISTS(SELECT * ...)
close table before opening in optimize mysql-test/r/subselect.result: test of EXISTS(SELECT * ...) mysql-test/t/subselect.test: test of EXISTS(SELECT * ...) sql/sql_base.cc: EXISTS(SELECT * ...) sql/sql_table.cc: close table before opening one
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/subselect.result18
1 files changed, 16 insertions, 2 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index a6ff608ab66..b8b899f4850 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -328,10 +328,10 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1
+2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Using index
Warnings:
Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
-Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
+Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
ERROR 23000: Column: 'a' in field list is ambiguous
drop table t1,t2,t3;
@@ -1817,3 +1817,17 @@ a
1
3
DROP TABLE t1;
+create table t1 (a int, b int);
+insert into t1 values (1,2),(3,4);
+select * from t1 up where exists (select * from t1 where t1.a=up.a);
+a b
+1 2
+3 4
+explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY up ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
+Warnings:
+Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a))
+drop table t1;