summaryrefslogtreecommitdiff
path: root/mysql-test/r/olap.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-09-15 21:34:11 +0400
committerunknown <evgen@moonbone.local>2005-09-15 21:34:11 +0400
commit36d163d6cf1f4ce522e081c378129f9723760d15 (patch)
tree0129651e804ae774cb6aa27282c6ebf228c4377b /mysql-test/r/olap.result
parent02fce1c316e7a33748eb7ccf13a49fbaa2926ee6 (diff)
downloadmariadb-git-36d163d6cf1f4ce522e081c378129f9723760d15.tar.gz
Fix bug#12887 Distinct is not always applied after rollup
For queries with GROUP BY and without hidden GROUP BY fields DISTINCT is optimized away becuase such queries produce result set without duplicates. But ROLLUP can add rows which may be same to some rows and this fact was ignored. Added check so if ROLLUP is present DISTINCT can't be optimized away. sql/sql_select.cc: Fix bug #12887 Distinct is not always applied after rollup mysql-test/r/olap.result: Test case for bug #12887 Distinct is not always applied after rollup mysql-test/t/olap.test: Test case for bug #12887 Distinct is not always applied after rollup
Diffstat (limited to 'mysql-test/r/olap.result')
-rw-r--r--mysql-test/r/olap.result12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 65f7c649624..fef990297d9 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -529,3 +529,15 @@ a LENGTH(a) COUNT(*)
2 1 1
NULL NULL 2
DROP TABLE t1;
+create table t1 ( a varchar(9), b int );
+insert into t1 values('a',1),(null,2);
+select a, max(b) from t1 group by a with rollup;
+a max(b)
+NULL 2
+a 1
+NULL 2
+select distinct a, max(b) from t1 group by a with rollup;
+a max(b)
+NULL 2
+a 1
+drop table t1;