summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-09-08 12:37:16 -0700
committerigor@rurik.mysql.com <>2005-09-08 12:37:16 -0700
commit19192328f29abd99155523d24f06a04888578494 (patch)
tree9393527c9e720464d7ebb01d185ba3e6ad37cec2 /mysql-test/t/olap.test
parent98a52fa9a434319a1c8ac1b859ca39fa62faa17e (diff)
downloadmariadb-git-19192328f29abd99155523d24f06a04888578494.tar.gz
sql_select.cc:
Fixed bug #12885. Forced inheritence of the maybe_null flag for the expressions containing GROUP BY attributes in selects with ROLLUP. olap.test, olap.result: Added test case for bug #12885.
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