[MDEV-30646] View created via JSON_ARRAYAGG returns incorrect json object Created: 2023-02-13  Updated: 2023-10-24

Status: Open
Project: MariaDB Server
Component/s: Data types, JSON
Affects Version/s: 10.5
Fix Version/s: 10.5

Type: Bug Priority: Critical
Reporter: Lena Startseva Assignee: Rucha Deodhar
Resolution: Unresolved Votes: 0
Labels: JSON_ARRAYAGG

Issue Links:
Relates
relates to MDEV-30405 check JSON data transfer Stalled

 Description   

Case repeats only in 10.5:

Test case:

CREATE VIEW v1 AS SELECT JSON_OBJECT(_LATIN1 'plugin', _LATIN1'unix_socket') as v1_json;
SELECT JSON_ARRAYAGG(v1_json) FROM v1;
DROP VIEW v1;
 
CREATE VIEW v1 AS SELECT JSON_OBJECT('plugin','unix_socket') as v1_json;
SELECT JSON_ARRAYAGG(v1_json) FROM v1;
DROP VIEW v1;

Expected result:

JSON_ARRAYAGG(v1_json)
[{"plugin": "unix_socket"}]
 
JSON_ARRAYAGG(v1_json)
[{"plugin": "unix_socket"}]

Actual result:

JSON_ARRAYAGG(v1_json)
["{\"plugin\": \"unix_socket\"}"]
 
JSON_ARRAYAGG(v1_json)
["{\"plugin\": \"unix_socket\"}"]


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