summaryrefslogtreecommitdiff
path: root/mysql-test/r/olap.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-03-15 22:50:54 -0800
committerunknown <igor@rurik.mysql.com>2005-03-15 22:50:54 -0800
commite16535ce1957567b1f176bdbcda766a8104a5072 (patch)
treeb4415fcad59a4372a3c783cb0b7acfcdf86ffef5 /mysql-test/r/olap.result
parent32e027ead7d65976dfcfaa95b7fa325a73783701 (diff)
downloadmariadb-git-e16535ce1957567b1f176bdbcda766a8104a5072.tar.gz
olap.result, olap.test:
Added a test case for bug #8616. item.h: Fixed bug #8616. Added class Item_null_result used in rollup processing. sql_select.h, sql_select.cc: Fixed bug #8616. Added JOIN::rollup_write_data to cover rollup queries with DISTINCT. Modified other rollup methods. sql/sql_select.cc: Fixed bug #8616. Added JOIN::rollup_write_data to cover rollup queries with DISTINCT. Modified other rollup methods. sql/sql_select.h: Fixed bug #8616. Added JOIN::rollup_write_data to cover rollup queries with DISTINCT. Modified other rollup methods. sql/item.h: Fixed bug #8616. Added class Item_null_result used in rollup processing. mysql-test/t/olap.test: Added a test case for bug #8616. mysql-test/r/olap.result: Added a test case for bug #8616.
Diffstat (limited to 'mysql-test/r/olap.result')
-rw-r--r--mysql-test/r/olap.result54
1 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index bcbe5a8791c..67610108c61 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -307,3 +307,57 @@ day sample not_cancelled
2004-06-07 1 0
NULL 3 1
DROP TABLE user_day;
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES
+(1,4),
+(2,2), (2,2),
+(4,1), (4,1), (4,1), (4,1),
+(2,1), (2,1);
+SELECT SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b)
+4
+6
+4
+14
+SELECT DISTINCT SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b)
+4
+6
+14
+SELECT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(DISTINCT b)
+4 1
+6 2
+4 1
+14 3
+SELECT DISTINCT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(DISTINCT b)
+4 1
+6 2
+14 3
+SELECT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(*)
+4 1
+6 4
+4 4
+14 9
+SELECT DISTINCT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(*)
+4 1
+6 4
+4 4
+14 9
+SELECT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(DISTINCT b) COUNT(*)
+4 1 1
+6 2 4
+4 1 4
+14 3 9
+SELECT DISTINCT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1
+GROUP BY a WITH ROLLUP;
+SUM(b) COUNT(DISTINCT b) COUNT(*)
+4 1 1
+6 2 4
+4 1 4
+14 3 9
+DROP TABLE t1;