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>2020-02-09 20:41:06 +0530
commit92faf41d5d4acf7a53fb473c13685c2afc121c73 (patch)
tree015b12fc54e878e42df8387018188958bafd3c4c
parentd1e9d2133dc5959811c65f7c82f82cd6197e03b5 (diff)
downloadmariadb-git-92faf41d5d4acf7a53fb473c13685c2afc121c73.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;