diff options
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r-- | mysql-test/t/olap.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 3aac0f45ead..4f3b0f51286 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -171,3 +171,16 @@ SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1; SELECT SQL_CALC_FOUND_ROWS a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1; DROP TABLE t1; + +# +# Tests for bug #9681: ROLLUP in subquery for derived table wiht +# a group by field declared as NOT NULL +# + +CREATE TABLE t1 (a int(11) NOT NULL); +INSERT INTO t1 VALUES (1),(2); + +SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP; +SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2; + +DROP TABLE t1; |