summaryrefslogtreecommitdiff
path: root/mysql-test/r/olap.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-04-19 16:54:30 -0700
committerunknown <igor@rurik.mysql.com>2005-04-19 16:54:30 -0700
commit6a97b07994f8d67c0f14b3979c932d69452ff94f (patch)
treedb2b83233b9c2e77c8be4330a4d8273a61999aa3 /mysql-test/r/olap.result
parent254dfb2be0075b15af30778b51321f784bf45ef5 (diff)
downloadmariadb-git-6a97b07994f8d67c0f14b3979c932d69452ff94f.tar.gz
sql_select.cc:
Fixed bug #9681. The bug happened with queries using derived tables specified by a SELECT with ROLLUP, such as: SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) t2, if column a of table t1 is declared as NOT NULL. This was to the fact that the first column of the temporary table created to contain the derived table erroneously inherited the NOT NULL attribute from column a. olap.result, olap.test: Added a test case for bug #9681. mysql-test/t/olap.test: Added a test case for bug #9681. mysql-test/r/olap.result: Added a test case for bug #9681. sql/sql_select.cc: Fixed bug #9681. The bug happened with queries using derived tables specified by a SELECT with ROLLUP, such as: SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) t2, if column a of table t1 is declared as NOT NULL. This was to the fact that the first column of the temporary table created to contain the derived table erroneously inherited the NOT NULL attribute from column a.
Diffstat (limited to 'mysql-test/r/olap.result')
-rw-r--r--mysql-test/r/olap.result13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 6500edf478f..341d51033f2 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -392,3 +392,16 @@ SELECT SQL_CALC_FOUND_ROWS a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
a SUM(b)
1 4
DROP TABLE t1;
+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;
+a m
+1 1
+2 2
+NULL 3
+SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2;
+a m
+1 1
+2 2
+NULL 3
+DROP TABLE t1;