summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived_cond_pushdown.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 14:33:07 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 14:33:07 +0300
commit6e9642beb2cafecbcb96e591e1b4466b877d4885 (patch)
tree39aa60527982a3a91946c9c6e0608992a309f178 /mysql-test/main/derived_cond_pushdown.test
parent8149e4d0a139b901c8902b5b9fae371cef47275f (diff)
parentdfa2d0bc13362b949b1b1699955583f74e7db90a (diff)
downloadmariadb-git-6e9642beb2cafecbcb96e591e1b4466b877d4885.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.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 5936447fc88..244ec1453a8 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2213,6 +2213,31 @@ select * from v1 where m > 0;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-25635: pushdown into grouping view using aggregate functions
+--echo # with constant arguments via a mergeable derived table
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (3), (7), (7), (3);
+
+create view v1 as select a, sum(1) as f, sum(1) as g from t1 group by a;
+select * from v1;
+let $q1=
+select * from (select * from v1) as dt where a=f and a=g;
+eval $q1;
+eval explain extended $q1;
+
+create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
+select * from v2;
+let $q2=
+select * from (select * from v2) as dt where a=f and a=g;
+eval $q2;
+eval explain extended $q2;
+
+drop view v1,v2;
+drop table t1;
+
--echo # End of 10.2 tests
--echo #