Loading mysql-test/r/olap.result +11 −0 Original line number Diff line number Diff line Loading @@ -715,3 +715,14 @@ a SUM(a) 4 4 NULL 14 DROP TABLE t1; # # Bug#31095: Unexpected NULL constant caused server crash. # create table t1(a int); insert into t1 values (1),(2),(3); select count(a) from t1 group by null with rollup; count(a) 3 3 drop table t1; ############################################################## mysql-test/t/olap.test +9 −0 Original line number Diff line number Diff line Loading @@ -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 ############################################################## sql/item_func.h +2 −0 Original line number Diff line number Diff line Loading @@ -749,6 +749,8 @@ class Item_func_rollup_const :public Item_func collation= args[0]->collation; max_length= args[0]->max_length; decimals=args[0]->decimals; /* The item could be a NULL constant. */ null_value= args[0]->null_value; } }; Loading Loading
mysql-test/r/olap.result +11 −0 Original line number Diff line number Diff line Loading @@ -715,3 +715,14 @@ a SUM(a) 4 4 NULL 14 DROP TABLE t1; # # Bug#31095: Unexpected NULL constant caused server crash. # create table t1(a int); insert into t1 values (1),(2),(3); select count(a) from t1 group by null with rollup; count(a) 3 3 drop table t1; ##############################################################
mysql-test/t/olap.test +9 −0 Original line number Diff line number Diff line Loading @@ -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 ##############################################################
sql/item_func.h +2 −0 Original line number Diff line number Diff line Loading @@ -749,6 +749,8 @@ class Item_func_rollup_const :public Item_func collation= args[0]->collation; max_length= args[0]->max_length; decimals=args[0]->decimals; /* The item could be a NULL constant. */ null_value= args[0]->null_value; } }; Loading