summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-08-08 18:49:22 +0200
committerunknown <serg@serg.mylan>2003-08-08 18:49:22 +0200
commit2e6d30072c501f30daff34c134cc4b4cba565950 (patch)
tree1fc5a8b533c387475e290fee927e8f98d950080d /mysql-test/t/range.test
parentbbc9d64fea129bd0a776a109ed1ceac75bf894b9 (diff)
downloadmariadb-git-2e6d30072c501f30daff34c134cc4b4cba565950.tar.gz
between tests added
bugfixes will follow
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r--mysql-test/t/range.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index bb0e696ea11..521709eddee 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -183,3 +183,20 @@ insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"),
select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1;
drop table t1;
+#
+# BETWEEN problems
+#
+create table t1 (x int, y int, index(x), index(y));
+insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
+update t1 set y=x;
+# between with only one end fixed
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0;
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0;
+# between with both expressions on both ends
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
+# equation propagation
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
+explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
+drop table t1;
+