summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 8981ddbe2e4..715bdf0e667 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3726,6 +3726,20 @@ cr.f4 = cr2.f4
GROUP BY a.f3, cr.f4;
drop table t1, t2, t3;
+
+
+#
+# Bug #40925: Equality propagation takes non indexed attribute
+#
+
+CREATE TABLE t1 (a INT KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
+
+EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2;
+EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
#