diff options
author | unknown <sergefp@mysql.com> | 2005-09-30 01:34:19 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-09-30 01:34:19 +0400 |
commit | 8bdb41ab8779ea02e4964031189b48d395117eb7 (patch) | |
tree | e99256dad31e2edb2926201d3320eb0e257dbc8e /mysql-test/t/range.test | |
parent | a5dd3d5d8f8e67cb74403f8265b9c61daf9d5ccd (diff) | |
download | mariadb-git-8bdb41ab8779ea02e4964031189b48d395117eb7.tar.gz |
Fix for BUG#13455: Make "ref" optimizer able to make this inference:
"t.key BETWEEN c1 AND c2" and c1 = c2 -> can access table t using "t.key = c1".
mysql-test/r/heap.result:
BUG#13455: updated test results
mysql-test/r/innodb.result:
BUG#13455: updated test results
mysql-test/r/myisam.result:
BUG#13455: updated test results
mysql-test/r/range.result:
Testcase for BUG#13455
mysql-test/t/range.test:
Testcase for BUG#13455
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index d8b3f5ef953..11c5e8d7bc5 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1, t2; +drop table if exists t1, t2, t3; --enable_warnings CREATE TABLE t1 ( @@ -600,3 +600,29 @@ explain select * from v1 where a between 3 and 4 and b between 1 and 2; drop view v1; drop table t1; + +# BUG#13455: +create table t3 (a int); +insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 (a varchar(10), filler char(200), key(a)) charset=binary; +insert into t1 values ('a',''); +insert into t1 values ('a ',''); +insert into t1 values ('a ', ''); +insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), '' + from t3 A, t3 B, t3 C; + +create table t2 (a varchar(10), filler char(200), key(a)); +insert into t2 select * from t1; + +--replace_column 9 # +explain select * from t1 where a between 'a' and 'a '; +--replace_column 9 # +explain select * from t1 where a = 'a' or a='a '; + +--replace_column 9 # +explain select * from t2 where a between 'a' and 'a '; +--replace_column 9 # +explain select * from t2 where a = 'a' or a='a '; + +drop table t1,t2,t3; |