summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-09-15 23:22:07 +0400
committerunknown <evgen@moonbone.local>2005-09-15 23:22:07 +0400
commitfa1bb240316e52964e94d9cd74a6b0e105729a47 (patch)
tree58a9973300d66cecb702bd077288091628f16e12 /mysql-test
parentfdc9e5d04b1ad18a4cf5edea2135624c92b9b510 (diff)
parentd400456702053e6b5d07764ab49550e5843043f8 (diff)
downloadmariadb-git-fa1bb240316e52964e94d9cd74a6b0e105729a47.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/12887-bug-5.0-mysql
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/olap.result12
-rw-r--r--mysql-test/t/olap.test10
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index df0ee09ea8e..225e306b3cf 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -580,6 +580,18 @@ 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;
CREATE TABLE t1(id int, type char(1));
INSERT INTO t1 VALUES
(1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index adaf6883d43..e34ac6a865c 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -274,6 +274,15 @@ SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
DROP TABLE t1;
+#
+# Bug #12887 Distinct is not always applied after rollup
+#
+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;
+select distinct a, max(b) from t1 group by a with rollup;
+drop table t1;
+
# End of 4.1 tests
#
@@ -309,3 +318,4 @@ SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
+# End of 4.1 tests