Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
-
None
-
Not for Release Notes
Description
When the document argument is in a charset with mbminlen > 1, the path lookup of JSON_EXTRACT / JSON_CONTAINS_PATH fails, while JSON_VALUE on the very same arguments succeeds.
Reproduced on 10.11.19 (debug build):
SELECT JSON_EXTRACT(CONVERT('{"a":[1,2]}' USING ucs2), '$.a[1]'), -- NULL |
JSON_CONTAINS_PATH(CONVERT('{"a":[1,2]}' USING ucs2), 'one', '$.a[1]'), -- 0 |
JSON_VALUE(CONVERT('{"a":[1,2]}' USING ucs2), '$.a[1]'); -- 2 |
 |
SELECT JSON_EXTRACT(CONVERT('{"a":1}' USING utf32), '$.a'), -- NULL |
JSON_CONTAINS_PATH(CONVERT('{"a":1}' USING utf32), 'one', '$.a'); -- 0 |
Expected: all three agree (2 / 1 / 2, and 1 / 1).
Related: MDEV-34173 (character_set_connection=ucs2) and MDEV-31539 (character_set_database=ucs2) cover the connection/database charset; here the document itself is in a wide charset and the three functions disagree with each other on identical arguments.
Attachments
Issue Links
- relates to
-
MDEV-34173 Some JSON functions print the output as NULL/incorrect when character-sets is set with mbminlen > 1
-
- Confirmed
-
-
MDEV-41890 JSON_EXTRACT finds a non-ASCII key in a VARBINARY document, JSON_EXISTS does not
-
- Confirmed
-