summaryrefslogtreecommitdiff
path: root/mysql-test/t/row.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-12-07 19:58:05 +0200
committerunknown <bell@sanja.is.com.ua>2002-12-07 19:58:05 +0200
commit5b54427d7d879a47893885dbfa0466b4bd69aaf1 (patch)
treeb3d232fd7ac288116ee7f63b6afd67c123484c67 /mysql-test/t/row.test
parent30cb4a8676427e6eafe3e38548a11e5859b587a3 (diff)
downloadmariadb-git-5b54427d7d879a47893885dbfa0466b4bd69aaf1.tar.gz
IN with row item without constant optimisation (SCRUM)
renamed row item test mysql-test/r/row.result: IN with row item without constant optimisation mysql-test/t/row.test: IN with row item without constant optimisation sql/item_cmpfunc.cc: IN with row item without constant optimisation sql/item_cmpfunc.h: IN with row item without constant optimisation
Diffstat (limited to 'mysql-test/t/row.test')
-rw-r--r--mysql-test/t/row.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
new file mode 100644
index 00000000000..4515d6b220d
--- /dev/null
+++ b/mysql-test/t/row.test
@@ -0,0 +1,42 @@
+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)=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);
+select * from t1 where ROW(a,2,3) IN(row(1,b,c), row(2,3,1));
+select * from t1 where ROW(c,2,3) IN(row(1,b,a), row(2,3,1));
+select * from t1 where ROW(a,b,c) IN(row(1,2,3), row(3,2,1));
+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;