mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-22236 JSON_ARRAYAGG query leads to SIGSEGV in Charset::swap on optimized builds.
The json_arrayagg::val_str should handle NULL result.
This commit is contained in:
@@ -3632,13 +3632,14 @@ String* Item_func_json_arrayagg::convert_to_json(Item *item, String *res)
|
||||
|
||||
String* Item_func_json_arrayagg::val_str(String *str)
|
||||
{
|
||||
str= Item_func_group_concat::val_str(str);
|
||||
String s;
|
||||
s.append('[');
|
||||
s.swap(*str);
|
||||
str->append(s);
|
||||
str->append(']');
|
||||
|
||||
if ((str= Item_func_group_concat::val_str(str)))
|
||||
{
|
||||
String s;
|
||||
s.append('[');
|
||||
s.swap(*str);
|
||||
str->append(s);
|
||||
str->append(']');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user