1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-30646 View created via JSON_ARRAYAGG returns incorrect json object

Backporting add782a13e from 10.6, this fixes the problem.
This commit is contained in:
Alexander Barkov
2024-04-27 08:54:38 +04:00
parent dc25d600ee
commit c6e3fe29d4
8 changed files with 59 additions and 12 deletions

View File

@ -1640,9 +1640,9 @@ SELECT t1.id, JSON_ARRAYAGG(JSON_OBJECT('id',t2.id) ORDER BY t2.id) as materials
from t1 LEFT JOIN t2 on t1.id = t2.owner_id
GROUP BY t1.id ORDER BY id;
id materials
1 ["{\"id\": 1}","{\"id\": 2}"]
2 ["{\"id\": 3}"]
3 ["{\"id\": 4}"]
1 [{"id": 1},{"id": 2}]
2 [{"id": 3}]
3 [{"id": 4}]
DROP TABLE t1;
DROP TABLE t2;
#