summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2007-10-01 20:03:50 +0000
committerevgen@moonbone.local <>2007-10-01 20:03:50 +0000
commit49af76ac8a42f6f971a115ee36a5ff6c56bc6dba (patch)
tree3c4a4aa0e3f4fa2b03ba29f3884b7b21184c62ac /mysql-test/t/olap.test
parent2a26db1ffd03e65efcad2ee3af596b8be371bdbf (diff)
downloadmariadb-git-49af76ac8a42f6f971a115ee36a5ff6c56bc6dba.tar.gz
Bug#31095: Unexpected NULL constant caused server crash.
The Item_func_rollup_const class is used for wrapping constants to avoid wrong result for ROLLUP queries with DISTINCT and a constant in the select list. This class is also used to wrap up a NULL constant but its null_value wasn't set accordingly. This led to a server crash. Now the null_value of an object of the Item_func_rollup_const class is set by its fix_length_and_dec member function.
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r--mysql-test/t/olap.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 05934bff492..1ac99d9c39f 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -358,3 +358,12 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
DROP TABLE t1;
+--echo #
+--echo # Bug#31095: Unexpected NULL constant caused server crash.
+--echo #
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+select count(a) from t1 group by null with rollup;
+drop table t1;
+--echo ##############################################################
+