summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived_cond_pushdown.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 15:02:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 15:02:40 +0300
commit72b248962136ccb08800d8267522549f0cdd4647 (patch)
tree1dbb0f39d6543b3b33cd395f9513140c6a6b0694 /mysql-test/main/derived_cond_pushdown.result
parentbb28bffc3ed179a9912aced2b873e43999111887 (diff)
parent6e9642beb2cafecbcb96e591e1b4466b877d4885 (diff)
downloadmariadb-git-72b248962136ccb08800d8267522549f0cdd4647.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/main/derived_cond_pushdown.result')
-rw-r--r--mysql-test/main/derived_cond_pushdown.result39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 52d8ccd1b80..8c7bec59e37 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -10631,6 +10631,45 @@ m
7
drop view v1;
drop table t1;
+#
+# MDEV-25635: pushdown into grouping view using aggregate functions
+# with constant arguments via a mergeable derived table
+#
+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;
+a f g
+1 1 1
+3 3 3
+7 3 3
+select * from (select * from v1) as dt where a=f and a=g;
+a f g
+1 1 1
+3 3 3
+explain extended select * from (select * from v1) as dt where a=f and a=g;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
+Warnings:
+Note 1003 /* select#1 */ select `v1`.`a` AS `a`,`v1`.`f` AS `f`,`v1`.`g` AS `g` from `test`.`v1` where `v1`.`a` = `v1`.`f` and `v1`.`a` = `v1`.`g`
+create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
+select * from v2;
+a f g
+1 1 1
+3 1 1
+7 1 1
+select * from (select * from v2) as dt where a=f and a=g;
+a f g
+1 1 1
+explain extended select * from (select * from v2) as dt where a=f and a=g;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
+Warnings:
+Note 1003 /* select#1 */ select `v2`.`a` AS `a`,`v2`.`f` AS `f`,`v2`.`g` AS `g` from `test`.`v2` where `v2`.`a` = `v2`.`f` and `v2`.`a` = `v2`.`g`
+drop view v1,v2;
+drop table t1;
# End of 10.2 tests
#
# MDEV-14579: pushdown conditions into materialized views/derived tables