diff options
author | unknown <bell@sanja.is.com.ua> | 2002-12-19 21:15:09 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-12-19 21:15:09 +0200 |
commit | a05b0f087c02eb7165a26e531f5e4cc34db0b173 (patch) | |
tree | 79e311ce07c95a3067d23f7bd8f90337175249d1 /mysql-test | |
parent | 900a86f63141bf78b3571518264c5076c3330587 (diff) | |
download | mariadb-git-a05b0f087c02eb7165a26e531f5e4cc34db0b173.tar.gz |
row IN subselects (SCRUM)
mysql-test/r/subselect.result:
test of row IN subslect
mysql-test/t/subselect.test:
test of row IN subslect
sql/item.cc:
New helper Item - reference on item list by number
cache item for row
sql/item.h:
layout fixed
New helper Item - reference on item list by number
cache item for row
sql/item_cmpfunc.cc:
changed Item_in_optimizer to be able work with row
sql/item_cmpfunc.h:
changed Item_in_optimizer to be able work with row
sql/item_row.cc:
Fixed row Item to be compatible with row subselect
sql/item_row.h:
Fixed row Item to be compatible with row subselect
sql/item_subselect.cc:
changed name of class to corerectly reflex its function
row IN subselect
sql/item_subselect.h:
changed name of class to corerectly reflex its function
row IN subselect
sql/sql_class.cc:
changed name of class to corerectly reflex its function
sql/sql_class.h:
changed name of class to corerectly reflex its function
sql/sql_yacc.yy:
changed name of class to corerectly reflex its function
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect.result | 31 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 14 |
2 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index d45b7b24585..f983825a56b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -773,3 +773,34 @@ a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where 2 0 b NULL NULL NULL drop table t1,t2; +drop table if exists t; +create table t (a int, b real, c varchar(10)); +insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); +select ROW(1, 1, 'a') IN (select a,b,c from t); +ROW(1, 1, 'a') IN (select a,b,c from t) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t); +ROW(1, 2, 'a') IN (select a,b,c from t) +NULL +select ROW(1, 1, 'a') IN (select b,a,c from t); +ROW(1, 1, 'a') IN (select b,a,c from t) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t where a is not null); +ROW(1, 1, 'a') IN (select a,b,c from t where a is not null) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t where a is not null); +ROW(1, 2, 'a') IN (select a,b,c from t where a is not null) +0 +select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null); +ROW(1, 1, 'a') IN (select b,a,c from t where a is not null) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a'); +ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a') +1 +select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a'); +ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a') +NULL +select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a'); +ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a') +1 +drop table if exists t; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index ee3d31e66af..863c5f0ad9c 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -434,3 +434,17 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2; select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2; drop table t1,t2; + +drop table if exists t; +create table t (a int, b real, c varchar(10)); +insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); +select ROW(1, 1, 'a') IN (select a,b,c from t); +select ROW(1, 2, 'a') IN (select a,b,c from t); +select ROW(1, 1, 'a') IN (select b,a,c from t); +select ROW(1, 1, 'a') IN (select a,b,c from t where a is not null); +select ROW(1, 2, 'a') IN (select a,b,c from t where a is not null); +select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null); +select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a'); +select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a'); +select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a'); +drop table if exists t; |