Commit 92faf41d authored by Varun Gupta's avatar Varun Gupta

Adding more test coverage

parent d1e9d213
...@@ -2278,6 +2278,26 @@ ORDER BY t1.b LIMIT 10; ...@@ -2278,6 +2278,26 @@ ORDER BY t1.b LIMIT 10;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a,a_b a_b 5 const 3 Using index condition; Using where 1 SIMPLE t1 ref a,a_b a_b 5 const 3 Using index condition; Using where
1 SIMPLE t2 ref b,c b 5 test.t1.b 1 Using where 1 SIMPLE t2 ref b,c b 5 test.t1.b 1 Using where
#
# Using index condition should not be present
#
SELECT * FROM t1,t2
WHERE
t1.a=2 AND t2.c >= 1 AND
t1.b=t2.b
ORDER BY t1.b DESC LIMIT 10;
a b c a b c
2 10 4 2 10 4
2 9 3 2 9 3
2 8 2 2 8 2
EXPLAIN SELECT * FROM t1,t2
WHERE
t1.a=2 AND t2.c >= 1 AND
t1.b=t2.b
ORDER BY t1.b DESC LIMIT 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a,a_b a_b 5 const 3 Using where
1 SIMPLE t2 ref b,c b 5 test.t1.b 1 Using where
drop table t1,t2; drop table t1,t2;
# TESTS with INDEX HINTS # TESTS with INDEX HINTS
create table t0 (a int); create table t0 (a int);
......
...@@ -909,6 +909,20 @@ ORDER BY t1.b LIMIT 10; ...@@ -909,6 +909,20 @@ ORDER BY t1.b LIMIT 10;
eval $query; eval $query;
eval EXPLAIN $query; eval EXPLAIN $query;
--echo #
--echo # Using index condition should not be present
--echo #
let $query=
SELECT * FROM t1,t2
WHERE
t1.a=2 AND t2.c >= 1 AND
t1.b=t2.b
ORDER BY t1.b DESC LIMIT 10;
eval $query;
eval EXPLAIN $query;
drop table t1,t2; drop table t1,t2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment