Skip to content

Commit

Permalink
MDEV-23004 When using GROUP BY with JSON_ARRAYAGG with joint table, t…
Browse files Browse the repository at this point in the history
…he square brackets are not included

make test results stable

followup for 98c7916
  • Loading branch information
vuvova committed Jun 30, 2021
1 parent 8711adb commit 83684fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mysql-test/main/func_json.result
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ CREATE TABLE t1(id int primary key, name varchar(50));
CREATE TABLE t2(id int, owner_id int);
INSERT INTO t1 VALUES (1, "name1"), (2, "name2"), (3, "name3");
INSERT INTO t2 VALUES (1, 1), (2, 1), (3, 2), (4, 3);
SELECT t1.id, JSON_ARRAYAGG(JSON_OBJECT('id',t2.id)) as materials
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
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/func_json.test
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ CREATE TABLE t2(id int, owner_id int);
INSERT INTO t1 VALUES (1, "name1"), (2, "name2"), (3, "name3");
INSERT INTO t2 VALUES (1, 1), (2, 1), (3, 2), (4, 3);

SELECT t1.id, JSON_ARRAYAGG(JSON_OBJECT('id',t2.id)) as materials
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;

Expand Down

0 comments on commit 83684fc

Please sign in to comment.