summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2019-10-09 16:05:53 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2019-10-09 16:05:53 +0530
commit8f4a4e8a0196e89f255b6d627199c8854cbc1ff8 (patch)
tree59095daf2a1ce1ff7ad8fbcbf6f0f41076ad1988
parent272186eaf8f65d1b00a93ef4483dbaf457af102e (diff)
downloadmariadb-git-8f4a4e8a0196e89f255b6d627199c8854cbc1ff8.tar.gz
Adding more test coverage
-rw-r--r--mysql-test/main/sort_nest.result20
-rw-r--r--mysql-test/main/sort_nest.test14
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/main/sort_nest.result b/mysql-test/main/sort_nest.result
index 3bc69cd5625..08e5b557a2f 100644
--- a/mysql-test/main/sort_nest.result
+++ b/mysql-test/main/sort_nest.result
@@ -2278,6 +2278,26 @@ ORDER BY t1.b 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 index condition; 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;
# TESTS with INDEX HINTS
create table t0 (a int);
diff --git a/mysql-test/main/sort_nest.test b/mysql-test/main/sort_nest.test
index 02f384d3957..ef50167d412 100644
--- a/mysql-test/main/sort_nest.test
+++ b/mysql-test/main/sort_nest.test
@@ -909,6 +909,20 @@ ORDER BY t1.b LIMIT 10;
eval $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;