Skip to content

Commit 2fcff31

Browse files
author
Alexey Botchkov
committed
MDEV-21902 Nested JSON_ARRAYAGG in JSON_OBJECT should not get escaped.
1 parent 7419838 commit 2fcff31

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

mysql-test/main/func_json.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ drop view v;
12431243
select json_arrayagg(a order by a asc) from (select 1 a union select 2 a) t;
12441244
json_arrayagg(a order by a asc)
12451245
[1,2]
1246+
select json_object('x', json_arrayagg(json_object('a', 1)));
1247+
json_object('x', json_arrayagg(json_object('a', 1)))
1248+
{"x": [{"a": 1}]}
12461249
#
12471250
# End of 10.5 tests
12481251
#

mysql-test/main/func_json.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ drop view v;
761761

762762
select json_arrayagg(a order by a asc) from (select 1 a union select 2 a) t;
763763

764+
select json_object('x', json_arrayagg(json_object('a', 1)));
765+
764766
--echo #
765767
--echo # End of 10.5 tests
766768
--echo #

sql/item.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5325,6 +5325,7 @@ class Item_ref :public Item_ident,
53255325
{
53265326
return ref ? (*ref)->get_typelib() : NULL;
53275327
}
5328+
bool is_json_type() { return (*ref)->is_json_type(); }
53285329

53295330
bool walk(Item_processor processor, bool walk_subquery, void *arg)
53305331
{

0 commit comments

Comments
 (0)