diff options
author | unknown <bell@sanja.is.com.ua> | 2002-12-10 11:45:40 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-12-10 11:45:40 +0200 |
commit | 6f88718fc9cffbb4cdff768de100691a70067272 (patch) | |
tree | f6ca7aa660a25caf3c2288ff373f1cb799f4e33b /mysql-test | |
parent | cd292d1f0375f8069fd230da38dcc1f6826674a3 (diff) | |
parent | 3b24e7c0657377283356d934f4da11e3b940f80b (diff) | |
download | mariadb-git-6f88718fc9cffbb4cdff768de100691a70067272.tar.gz |
merging
sql/item_cmpfunc.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/row.result | 130 | ||||
-rw-r--r-- | mysql-test/r/row_test.result | 60 | ||||
-rw-r--r-- | mysql-test/t/row.test | 59 | ||||
-rw-r--r-- | mysql-test/t/row_test.test | 36 |
4 files changed, 189 insertions, 96 deletions
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result new file mode 100644 index 00000000000..e0b524d9bb2 --- /dev/null +++ b/mysql-test/r/row.result @@ -0,0 +1,130 @@ +select row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)); +row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)) +1 +select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)); +row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)) +0 +select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)) +1 +select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)) +NULL +select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')); +row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')) +1 +select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)); +row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)) +1 +select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3)); +row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3)) +1 +select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)) +1 +select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)) +NULL +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,4))); +row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,4))) +1 +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4)); +Cardinality error (more/less than 2 columns) +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))); +row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))) +NULL +SELECT ROW(1,2,3)=ROW(1,2,3); +ROW(1,2,3)=ROW(1,2,3) +1 +SELECT ROW(2,2,3)=ROW(1+1,2,3); +ROW(2,2,3)=ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)=ROW(1+1,2,3); +ROW(1,2,3)=ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<ROW(1+1,2,3); +ROW(1,2,3)<ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)>ROW(1+1,2,3); +ROW(1,2,3)>ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<=ROW(1+1,2,3); +ROW(1,2,3)<=ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)>=ROW(1+1,2,3); +ROW(1,2,3)>=ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<>ROW(1+1,2,3); +ROW(1,2,3)<>ROW(1+1,2,3) +1 +SELECT ROW(NULL,2,3)=ROW(NULL,2,3); +ROW(NULL,2,3)=ROW(NULL,2,3) +NULL +SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); +ROW(NULL,2,3)<=>ROW(NULL,2,3) +1 +SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); +ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)) +1 +SELECT ROW('test',2,3.33)=ROW('test',2,3.33); +ROW('test',2,3.33)=ROW('test',2,3.33) +1 +SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); +Cardinality error (more/less than 3 columns) +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33)) +1 +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3)) +0 +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)) +NULL +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4); +Cardinality error (more/less than 2 columns) +drop table if exists t1; +create table t1 ( a int, b int, c int); +insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL); +select * from t1 where ROW(1,2,3)=ROW(a,b,c); +a b c +1 2 3 +select * from t1 where ROW(0,2,3)=ROW(a,b,c); +a b c +select * from t1 where ROW(1,2,3)<ROW(a,b,c); +a b c +2 3 1 +3 2 1 +select ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) from t1; +ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) +1 +0 +0 +NULL +select ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) from t1; +ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) +0 +0 +1 +NULL +select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1; +ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) +1 +0 +1 +NULL +select ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) from t1; +ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) +1 +1 +1 +1 +drop table t1; +select ROW(1,1); +Cardinality error (more/less than 1 columns) +drop table if exists t1; +create table t1 (i int); +select 1 from t1 where ROW(1,1); +Cardinality error (more/less than 1 columns) +select count(*) from t1 order by ROW(1,1); +Cardinality error (more/less than 1 columns) +drop table t1; diff --git a/mysql-test/r/row_test.result b/mysql-test/r/row_test.result deleted file mode 100644 index f6e989789c7..00000000000 --- a/mysql-test/r/row_test.result +++ /dev/null @@ -1,60 +0,0 @@ -SELECT ROW(1,2,3)=ROW(1,2,3); -ROW(1,2,3)=ROW(1,2,3) -1 -SELECT ROW(2,2,3)=ROW(1+1,2,3); -ROW(2,2,3)=ROW(1+1,2,3) -1 -SELECT ROW(1,2,3)=ROW(1+1,2,3); -ROW(1,2,3)=ROW(1+1,2,3) -0 -SELECT ROW(1,2,3)<ROW(1+1,2,3); -ROW(1,2,3)<ROW(1+1,2,3) -1 -SELECT ROW(1,2,3)>ROW(1+1,2,3); -ROW(1,2,3)>ROW(1+1,2,3) -0 -SELECT ROW(1,2,3)<=ROW(1+1,2,3); -ROW(1,2,3)<=ROW(1+1,2,3) -1 -SELECT ROW(1,2,3)>=ROW(1+1,2,3); -ROW(1,2,3)>=ROW(1+1,2,3) -0 -SELECT ROW(1,2,3)<>ROW(1+1,2,3); -ROW(1,2,3)<>ROW(1+1,2,3) -1 -SELECT ROW(NULL,2,3)=ROW(NULL,2,3); -ROW(NULL,2,3)=ROW(NULL,2,3) -NULL -SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); -ROW(NULL,2,3)<=>ROW(NULL,2,3) -1 -SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); -ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)) -1 -SELECT ROW('test',2,3.33)=ROW('test',2,3.33); -ROW('test',2,3.33)=ROW('test',2,3.33) -1 -SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); -Cardinality error (more/less than 3 columns) -drop table if exists t1; -create table t1 ( a int, b int, c int); -insert into t1 values (1,2,3), (2,3,1), (3,2,1); -select * from t1 where ROW(1,2,3)=ROW(a,b,c); -a b c -1 2 3 -select * from t1 where ROW(0,2,3)=ROW(a,b,c); -a b c -select * from t1 where ROW(1,2,3)<ROW(a,b,c); -a b c -2 3 1 -3 2 1 -drop table t1; -select ROW(1,1); -Cardinality error (more/less than 1 columns) -drop table if exists t1; -create table t1 (i int); -select 1 from t1 where ROW(1,1); -Cardinality error (more/less than 1 columns) -select count(*) from t1 order by ROW(1,1); -Cardinality error (more/less than 1 columns) -drop table t1; diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test new file mode 100644 index 00000000000..04f31fcbfe1 --- /dev/null +++ b/mysql-test/t/row.test @@ -0,0 +1,59 @@ +select row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)); +select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)); +select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')); +select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)); +select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3)); +select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,4))); +-- error 1239 +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4)); +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))); + +SELECT ROW(1,2,3)=ROW(1,2,3); +SELECT ROW(2,2,3)=ROW(1+1,2,3); +SELECT ROW(1,2,3)=ROW(1+1,2,3); +SELECT ROW(1,2,3)<ROW(1+1,2,3); +SELECT ROW(1,2,3)>ROW(1+1,2,3); +SELECT ROW(1,2,3)<=ROW(1+1,2,3); +SELECT ROW(1,2,3)>=ROW(1+1,2,3); +SELECT ROW(1,2,3)<>ROW(1+1,2,3); +SELECT ROW(NULL,2,3)=ROW(NULL,2,3); +SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); +SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); +SELECT ROW('test',2,3.33)=ROW('test',2,3.33); +-- error 1239 +SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33)); +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3)); +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)); +-- error 1239 +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4); +drop table if exists t1; +create table t1 ( a int, b int, c int); +insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL); +select * from t1 where ROW(1,2,3)=ROW(a,b,c); +select * from t1 where ROW(0,2,3)=ROW(a,b,c); +select * from t1 where ROW(1,2,3)<ROW(a,b,c); +select ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) from t1; +select ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) from t1; +select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1; +select ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) from t1; +drop table t1; + +-- error 1239 +select ROW(1,1); +drop table if exists t1; +create table t1 (i int); +-- error 1239 +select 1 from t1 where ROW(1,1); +-- error 1239 +select count(*) from t1 order by ROW(1,1); +#TODO remove comments after parser fixing +#-- error 1239 +#select count(*) from t1 order by i having (1,1); +#-- error 1239 +#select 1 from t1 limit (1,1), (1,1); +drop table t1; diff --git a/mysql-test/t/row_test.test b/mysql-test/t/row_test.test deleted file mode 100644 index 5daacaa1ee6..00000000000 --- a/mysql-test/t/row_test.test +++ /dev/null @@ -1,36 +0,0 @@ -SELECT ROW(1,2,3)=ROW(1,2,3); -SELECT ROW(2,2,3)=ROW(1+1,2,3); -SELECT ROW(1,2,3)=ROW(1+1,2,3); -SELECT ROW(1,2,3)<ROW(1+1,2,3); -SELECT ROW(1,2,3)>ROW(1+1,2,3); -SELECT ROW(1,2,3)<=ROW(1+1,2,3); -SELECT ROW(1,2,3)>=ROW(1+1,2,3); -SELECT ROW(1,2,3)<>ROW(1+1,2,3); -SELECT ROW(NULL,2,3)=ROW(NULL,2,3); -SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); -SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); -SELECT ROW('test',2,3.33)=ROW('test',2,3.33); --- error 1239 -SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); -drop table if exists t1; -create table t1 ( a int, b int, c int); -insert into t1 values (1,2,3), (2,3,1), (3,2,1); -select * from t1 where ROW(1,2,3)=ROW(a,b,c); -select * from t1 where ROW(0,2,3)=ROW(a,b,c); -select * from t1 where ROW(1,2,3)<ROW(a,b,c); -drop table t1; - --- error 1239 -select ROW(1,1); -drop table if exists t1; -create table t1 (i int); --- error 1239 -select 1 from t1 where ROW(1,1); --- error 1239 -select count(*) from t1 order by ROW(1,1); -#TODO remove comments after parser fixing -#-- error 1239 -#select count(*) from t1 order by i having (1,1); -#-- error 1239 -#select 1 from t1 limit (1,1), (1,1); -drop table t1; |