diff options
Diffstat (limited to 'mysql-test/r/subselect.result')
-rw-r--r-- | mysql-test/r/subselect.result | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index fb91bebd727..dada87803ad 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1,7 +1,7 @@ select (select 2); (select 2) 2 -drop table if exists t1,t2,t3,t4,attend,clinic; +drop table if exists t1,t2,t3,t4,t5,attend,clinic; create table t1 (a int); create table t2 (a int, b int); create table t3 (a int); @@ -82,6 +82,23 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b); b ma 7 12 +create table t5 (a int); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (5); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (2); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; +Subselect return more than 1 record create table attend (patient_uq int, clinic_uq int, index i1 (clinic_uq)); create table clinic( uq int primary key, name char(25)); insert into clinic values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta"); @@ -91,4 +108,4 @@ patient_uq clinic_uq 1 1 1 2 2 2 -drop table t1,t2,t3,t4,attend,clinic; +drop table t1,t2,t3,t4,t5,attend,clinic; |