diff options
author | sergefp@pylon.mylan <> | 2006-09-19 21:14:37 +0400 |
---|---|---|
committer | sergefp@pylon.mylan <> | 2006-09-19 21:14:37 +0400 |
commit | fb077c0efd02bc1503f0267ce4d7c94117f3e505 (patch) | |
tree | 986cdf8c6826c347038b7a850faba880076f6092 /mysql-test/t/range.test | |
parent | ba7a873172cbff6ee686c43f2a02ec13ada72ad3 (diff) | |
parent | 13901802bcdc24094504e392b100a934174a11e3 (diff) | |
download | mariadb-git-fb077c0efd02bc1503f0267ce4d7c94117f3e505.tar.gz |
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into mysql.com:/home/psergey/mysql-5.1-bug22393
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 89508f468a7..1a80234e485 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -740,3 +740,30 @@ SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; DROP TABLE t1; # End of 5.0 tests + +# BUG#22393 fix: Adjust 'ref' estimate if we have 'range' estimate for +# a smaller scan interval +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2 (a int, b int, filler char(100)); +insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, +t1 B, t1 C where A.a < 5; + +insert into t2 select 1000, b, 'filler' from t2; +alter table t2 add index (a,b); +# t2 values +# ( 1 , 10, 'filler') +# ( 2 , 10, 'filler') +# ( 3 , 10, 'filler') +# (... , 10, 'filler') +# ... +# (1000, 10, 'filler') - 500 times + +# 500 rows, 1 row + +select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z; +explain select * from t2 where a=1000 and b<11; + +drop table t1, t2; + |