[MDEV-23069] Duplicate square brackets in JSON_ARRAYAGG upon query with HAVING Created: 2020-07-01  Updated: 2022-06-01

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

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Rucha Deodhar
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-23068 Unbalanced brackets in JSON_OBJECTAGG... Open

 Description   

CREATE TABLE t1 (a INT, b VARCHAR(10));
INSERT INTO t1 VALUES (1,"foo"), (2,"bar");
 
SELECT a, JSON_ARRAYAGG(b) as j FROM t1 GROUP BY a HAVING j = '["foo"]';

Actual result, 10.5 baca526555

MariaDB [test]> SELECT a, JSON_ARRAYAGG(b) as j FROM t1 GROUP BY a HAVING j = '["foo"]';
+------+-----------+
| a    | j         |
+------+-----------+
|    1 | [["foo"]] |
+------+-----------+
1 row in set (0.002 sec)


Generated at Thu Feb 08 09:19:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.