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/r/range.result | |
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/r/range.result')
-rw-r--r-- | mysql-test/r/range.result | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 6adbea973df..69c150fc0b7 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1,4 +1,4 @@ -drop table if exists t1, t2; +drop table if exists t1, t2, t3; CREATE TABLE t1 ( event_date date DEFAULT '0000-00-00' NOT NULL, type int(11) DEFAULT '0' NOT NULL, @@ -787,3 +787,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index drop view v1; drop table t1; +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; +explain select * from t1 where a between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +explain select * from t1 where a = 'a' or a='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +explain select * from t2 where a between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref a a 13 const # Using where +explain select * from t2 where a = 'a' or a='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref a a 13 const # Using where +drop table t1,t2,t3; |