Commit 8a9048bc authored by Monty's avatar Monty

MDEV-16170 Server crashes in Item_null_result::type_handler on SELECT with ROLLUP

Problem was that I in a previous patch enabled ifdef:ed code intended for
10.3 but that never worked.

Reverted to original code
parent e7fc8cd6
......@@ -2832,3 +2832,14 @@ select distinct 1 from t1 group by a,b with rollup limit 1;
1
1
drop table t1;
#
# MDEV-16170
# Server crashes in Item_null_result::type_handler on SELECT with ROLLUP
#
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('2032-10-08');
SELECT d != '2023-03-04' AS f, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP;
f COUNT(*)
1 1
NULL 1
DROP TABLE t1;
......@@ -1948,3 +1948,12 @@ insert into t1 values(-126,7),(1,1),(0,0),(-1,1),(351,65534);
select distinct 1 from t1 group by a,b with rollup limit 1;
drop table t1;
--echo #
--echo # MDEV-16170
--echo # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP
--echo #
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('2032-10-08');
SELECT d != '2023-03-04' AS f, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP;
DROP TABLE t1;
......@@ -3185,9 +3185,9 @@ class Item_null_result :public Item_null
Field *result_field;
Item_null_result(THD *thd): Item_null(thd), result_field(0) {}
bool is_result_field() { return result_field != 0; }
const Type_handler *type_handler() const
enum_field_types field_type() const
{
return result_field->type_handler();
return result_field->type();
}
void save_in_result_field(bool no_conversions)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment