summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2019-02-23 22:16:33 +0300
committerGalina Shalygina <galina.shalygina@mariadb.com>2019-03-07 12:35:18 +0300
commit2faefe5f7f432f8d9b3435dd8f4e2a37163c5527 (patch)
tree34c317557f3e364035f37687e06fa856a1f7ca8a /mysql-test/r
parent57dd892ce8dc93bcd7eee953e01ebe8ed7e414c8 (diff)
downloadmariadb-git-2faefe5f7f432f8d9b3435dd8f4e2a37163c5527.tar.gz
MDEV-18383: Missing rows with pushdown condition defined with IF-function
using Item_cond This bug is similar to the bug MDEV-16765. It appears because of the wrong pushdown into HAVING clause while this pushdown shouldn't be made at all. This happens because function that checks if Item_cond can be pushed always returns that it can be pushed. To fix it new method Item_cond::excl_dep_on_table() was added.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/derived_cond_pushdown.result21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result
index 14c8e4d5e8f..00acdf241a6 100644
--- a/mysql-test/r/derived_cond_pushdown.result
+++ b/mysql-test/r/derived_cond_pushdown.result
@@ -10480,4 +10480,25 @@ EXPLAIN
}
DROP VIEW v1,v2;
DROP TABLE t1;
+#
+# MDEV-18383: pushdown condition with the IF structure
+# defined with Item_cond item
+#
+CREATE TABLE t1(a INT, b INT);
+CREATE TABLE t2(c INT, d INT);
+INSERT INTO t1 VALUES (1,2),(3,4),(5,6);
+INSERT INTO t2 VALUES (1,3),(3,7),(5,1);
+SELECT *
+FROM t1,
+(
+SELECT MAX(d) AS max_d,c
+FROM t2
+GROUP BY c
+) AS tab
+WHERE t1.a=tab.c AND
+IF(2,t1.a=1 OR t1.b>5,1=1);
+a b max_d c
+1 2 3 1
+5 6 1 5
+DROP TABLE t1,t2;
# End of 10.2 tests