Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1
Description
Hi,
I found that the JSON_OBJECTAGG function is not limited by group_concat_max_len. This is an example:
SET SESSION group_concat_max_len=32; |
|
|
CREATE TABLE t(k VARCHAR(8), v VARCHAR(64)); |
INSERT INTO t VALUES |
('a', REPEAT('x', 20)), |
('b', REPEAT('y', 20)); |
|
|
SELECT JSON_ARRAYAGG(v) FROM t; -- ["xxxxxxxxxxxxxxxxxxxx","yyyyyyy"] |
SHOW WARNINGS; -- Warning 1260 Row 2 was cut by json_arrayagg() |
|
|
SELECT
|
JSON_OBJECTAGG(k, v),
|
OCTET_LENGTH(JSON_OBJECTAGG(k, v)),
|
OCTET_LENGTH(JSON_OBJECTAGG(k, v)) > @@group_concat_max_len
|
FROM t; -- {"a":"xxxxxxxxxxxxxxxxxxxx", "b":"yyyyyyyyyyyyyyyyyyyy"} 56 1 |
SHOW WARNINGS; -- empty |