[MDEV-21902] Nested JSON_ARRAYAGG in JSON_OBJECT should not get escaped Created: 2020-03-10  Updated: 2022-01-19  Resolved: 2020-06-04

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

Type: Bug Priority: Major
Reporter: Lukas Eder Assignee: Alexey Botchkov
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-16620 Add support for JSON_ARRAYAGG and JSO... Closed
relates to MDEV-26506 Over-quoted JSON when combining JSON_... Closed

 Description   

When running this query:

select json_object('x', json_arrayagg(json_object('a', 1)));

I'm getting this content (with the JSON_ARRAYAGG content being embedded in a string).

{"x": [{"a": 1}]}

I'm expecting this instead:

{"x": "[{\"a\": 1}]"}

I'm getting the expected result in MySQL or in Oracle. In the case of Oracle, use this syntax for comparison:

select json_object('x' value json_arrayagg(json_object('a' value 1))) from dual;



 Comments   
Comment by Alexey Botchkov [ 2020-06-04 ]

https://github.com/MariaDB/server/commit/2fcff310d024cc2201586c568391ba8b039f0bf3

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