summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived_cond_pushdown.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-08 00:26:55 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-08 00:26:55 +0200
commit2d0dd62cf7e824f5bbc8d0367730adcdaf0eed68 (patch)
tree804b14fb55650c3af866d8bc19048594569e7f98 /mysql-test/main/derived_cond_pushdown.test
parentd30f17af4969cc1ce34f1925f5ea2bced9c6f7e9 (diff)
parentbf71d263621c90cbddc7bde9bf071dae503f333f (diff)
downloadmariadb-git-2d0dd62cf7e824f5bbc8d0367730adcdaf0eed68.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/derived_cond_pushdown.test')
-rw-r--r--mysql-test/main/derived_cond_pushdown.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 076d39c1abd..c6c8c26271f 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2102,6 +2102,28 @@ eval EXPLAIN FORMAT=JSON $q2;
DROP VIEW v1,v2;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18383: pushdown condition with the IF structure
+--echo # defined with Item_cond item
+--echo #
+
+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);
+
+DROP TABLE t1,t2;
+
--echo # End of 10.2 tests
--echo #