diff options
author | igor@rurik.mysql.com <> | 2005-03-15 22:50:54 -0800 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2005-03-15 22:50:54 -0800 |
commit | ce6c390c390b1993edade781c0ee21b07eb741cc (patch) | |
tree | b4415fcad59a4372a3c783cb0b7acfcdf86ffef5 /mysql-test/r/olap.result | |
parent | 6c00af77a07194effdf5aa23196b4e47efb6e203 (diff) | |
download | mariadb-git-ce6c390c390b1993edade781c0ee21b07eb741cc.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.
Diffstat (limited to 'mysql-test/r/olap.result')
-rw-r--r-- | mysql-test/r/olap.result | 54 |
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; |