1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
igor@rurik.mysql.com
2005-03-15 22:50:54 -08:00
parent 6c00af77a0
commit ce6c390c39
5 changed files with 186 additions and 27 deletions

View File

@ -125,3 +125,30 @@ SELECT
DROP TABLE user_day;
#
# Test for bug #8616: distinct sum with rollup
#
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;
SELECT DISTINCT SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
SELECT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
SELECT DISTINCT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
SELECT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
SELECT DISTINCT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
SELECT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
SELECT DISTINCT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1
GROUP BY a WITH ROLLUP;
DROP TABLE t1;