summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r--mysql-test/t/olap.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index c9a16b897c6..76c62d14621 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -250,4 +250,17 @@ SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
DROP TABLE t1;
+#
+# Bug #11885: derived table specified by a subquery with
+# ROLLUP over expressions on not nullable group by attributes
+#
+
+CREATE TABLE t1 (a int(11) NOT NULL);
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT * FROM (SELECT a, a + 1, COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
+SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
+
+DROP TABLE t1;
+
# End of 4.1 tests