diff options
author | unknown <ramil/ram@ramil.myoffice.izhnet.ru> | 2007-11-23 12:35:02 +0400 |
---|---|---|
committer | unknown <ramil/ram@ramil.myoffice.izhnet.ru> | 2007-11-23 12:35:02 +0400 |
commit | 6cc8a820d3ad135bed4fd569ae6d43cc56181944 (patch) | |
tree | da944ed1f4cebb10ba1167a1c065f3e1ea68236f | |
parent | d263bdcf0041b7ef86152ee19eba1021e7dd87d8 (diff) | |
parent | 0c2dac2a8bfc41e09b127d7f011dcdd4a22a5b88 (diff) | |
download | mariadb-git-6cc8a820d3ad135bed4fd569ae6d43cc56181944.tar.gz |
Merge mysql.com:/home/ram/work/b32558/b32558.5.0
into mysql.com:/home/ram/work/b32558/b32558.5.1
mysql-test/r/olap.result:
Auto merged
sql/item_func.h:
Auto merged
-rw-r--r-- | mysql-test/r/olap.result | 8 | ||||
-rw-r--r-- | mysql-test/t/olap.test | 9 | ||||
-rw-r--r-- | sql/item_func.h | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 63c9590401c..4540c9d5218 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -726,3 +726,11 @@ count(a) 3 drop table t1; ############################################################## +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP; +1 +1 +1 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 1ac99d9c39f..d1e40024733 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -367,3 +367,12 @@ select count(a) from t1 group by null with rollup; drop table t1; --echo ############################################################## +# +# Bug #32558: group by null-returning expression with rollup causes crash +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item_func.h b/sql/item_func.h index 4d7c96a18c1..629d0dbfdbc 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -789,7 +789,7 @@ public: max_length= args[0]->max_length; decimals=args[0]->decimals; /* The item could be a NULL constant. */ - null_value= args[0]->null_value; + null_value= args[0]->is_null(); } }; |