Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1
Description
SELECT JSON_OBJECT('a',1,'a',2); |
-- MariaDB: {"a": 1, "a": 2} <-- duplicate keys, invalid per RFC 8259 |
-- MySQL : {"a": 2} <-- last value wins, valid |
|
|
SELECT JSON_VALID(JSON_OBJECT('a',1,'a',2)); -- MariaDB: 1 (invalid document judged valid) |
SELECT JSON_EXTRACT(JSON_OBJECT('a',1,'a',2),'$.a'); -- 1 (first value taken) |
Violates RFC 8259 (object keys must be unique), producing a document strict parsers cannot consume;
JSON_VALID returns 1 for the duplicate-key document (verification distortion; dirty data can enter JSON columns);
Extraction takes the first value while MySQL semantics is "last value wins" — the same document resolves differently across the two systems (JSON_OBJECT results replicated from MySQL→MariaDB extract different values).
Attachments
Issue Links
- relates to
-
MDEV-12789 JSON_KEYS returns duplicate keys twice
-
- Closed
-