Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5.4
-
Built from source.
Description
I might be missing somthing totally trivial, but the following example doesn't look correct to me:
(psergey: fixed formatting)
CREATE TABLE t ( |
e INTEGER, |
a VARCHAR(255), |
v VARCHAR(255) |
);
|
|
INSERT INTO t VALUES (0, 'a1', '1') |
, (0, 'a2', '2') |
, (1, 'b1', '3'); |
|
SELECT e, JSON_OBJECTAGG(a, v) |
FROM t |
GROUP BY e; |
This is what I get:
MariaDB 5.5.5-10.5.4-MariaDB> SELECT e, JSON_OBJECTAGG(a, v)
|
-> FROM t
|
-> GROUP BY e;
|
+------+----------------------+
|
| e | JSON_OBJECTAGG(a, v) |
|
+------+----------------------+
|
| 0 | NULL |
|
| 1 | NULL |
|
+------+----------------------+
|
2 rows in set (0.00 sec)
|
The second column is NULL, although it should contain the actual data (like MySQL does).
Removing the GROUP BY yields a correct result.