summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-04-29 18:32:59 -0700
committerunknown <igor@olga.mysql.com>2007-04-29 18:32:59 -0700
commit532f2e84160e14b8f1a9104ec673af778e8950a6 (patch)
tree4f41906a0d61ce1b1e7d1ceb6ce8830dfded7627 /mysql-test/t/olap.test
parentba967f5b43dd1bb0f303bdeee55aeb630ea829a7 (diff)
parentc004ad09444b8b3be367b6620aa4f0716684bdc3 (diff)
downloadmariadb-git-532f2e84160e14b8f1a9104ec673af778e8950a6.tar.gz
Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24856 sql/item_func.h: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/olap.result: Manual merge. mysql-test/t/olap.test: Manual merge.
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r--mysql-test/t/olap.test22
1 files changed, 19 insertions, 3 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index e6cbfe3166c..05934bff492 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -292,6 +292,25 @@ select left(a,10), a, sum(b) from t1 group by 1,2 with rollup;
select left(a,10) x, a, sum(b) from t1 group by x,a with rollup;
drop table t1;
+#
+# Bug #24856: ROLLUP by const item in a query with DISTINCT
+#
+
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1
+ VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10);
+
+SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+
+SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+
+DROP TABLE t1;
+
# End of 4.1 tests
#
@@ -339,6 +358,3 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
DROP TABLE t1;
-
-
-