Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
13.1
-
None
-
Not for Release Notes
Description
Hi,
I found that when a JSON data has a NULL key, the array wildcard of the JSON path will return incorrect results:
SELECT JSON_QUERY('{"a":[0,{"b":1}]}', '$.a[*]'); -- {"b":1}, expected |
SELECT JSON_QUERY('{"a":[null,{"b":1}]}', '$.a[*]'); -- NULL, unexpected |
SELECT JSON_QUERY('{"a":[null,{"b":1}]}', '$.a[1]'); -- {"b":1}, expected |
SELECT JSON_KEY_VALUE('{"a":[0,{"b":1}]}', '$.a[*]'); -- [{"key": "b", "value": 1}], expected |
SELECT JSON_KEY_VALUE('{"a":[null,{"b":1}]}', '$.a[*]'); -- NULL, unexpected |
SELECT JSON_KEY_VALUE('{"a":[null,{"b":1}]}', '$.a[1]'); -- [{"key": "b", "value": 1}], expected |
Attachments
Issue Links
- duplicates
-
MDEV-39934 Incorrect result of JSON_QUERY and JSON_KEY_VALUE with wildcard
-
- Confirmed
-