[MDEV-21912] JSON_ARRAYAGG(NULL) crashes the server Created: 2020-03-11  Updated: 2020-03-11  Resolved: 2020-03-11

Status: Closed
Project: MariaDB Server
Component/s: JSON, Server
Affects Version/s: 10.5.1
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Lukas Eder Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-21528 json_arrayagg crashes in Item_func_gr... Closed

 Description   

I'm using MariaDB 10.5.1-MariaDB-1:10.5.1+maria~bionic on Docker for Windows. The following query crashes the server:

select json_arrayagg(null);

All sorts of alternative ways to aggregate null lead to the same effect:

select json_arrayagg((select null));
select json_arrayagg(a) from (select null a) t;

But if there are more than 1 null values, the result is as expected:

select json_arrayagg(a) from (select null a union all select null) t;

Yields

[null, null]


Generated at Thu Feb 08 09:10:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.