1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

fix JSON_ARRAYAGG not to over-quote json in joins

use metadata (in particular is_json() property) of the original
argument item, even if the actual argument was later replaced
with an Item_temptable_field
This commit is contained in:
Sergei Golubchik
2021-06-30 01:00:50 +02:00
parent c8fb911e9c
commit 8711adb786
2 changed files with 5 additions and 5 deletions

View File

@@ -1376,9 +1376,9 @@ SELECT t1.id, JSON_ARRAYAGG(JSON_OBJECT('id',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;
#