Details
Description
_Note: it might be a documentation issue, please then documented it properly. For now, I don't see anything that would suggest this difference in behavior between JSON_VALUE / JSON_QUERY and JSON_EXTRACT
MariaDB [test]> SELECT JSON_EXTRACT('{"foo":{"bar":"qux"}}','$**.bar'); |
+-------------------------------------------------+ |
| JSON_EXTRACT('{"foo":{"bar":"qux"}}','$**.bar') | |
+-------------------------------------------------+ |
| ["qux"] | |
+-------------------------------------------------+ |
1 row in set (0.00 sec) |
MariaDB [test]> SELECT JSON_QUERY('{"foo":{"bar":"qux"}}','$**.bar'); |
+-----------------------------------------------+ |
| JSON_QUERY('{"foo":{"bar":"qux"}}','$**.bar') | |
+-----------------------------------------------+ |
| NULL | |
+-----------------------------------------------+ |
1 row in set (0.00 sec) |
MariaDB [test]> SELECT JSON_VALUE('{"foo":{"bar":"qux"}}','$**.bar'); |
+-----------------------------------------------+ |
| JSON_VALUE('{"foo":{"bar":"qux"}}','$**.bar') | |
+-----------------------------------------------+ |
| NULL | |
+-----------------------------------------------+ |
1 row in set (0.01 sec) |
Given the current description of JSON_VALUE and JSON_QUERY, I would expect one of them to return a non-null value.
Attachments
Issue Links
- is duplicated by
-
MDEV-24259 JSON_EXTRACT returns wrong result with **
-
- Confirmed
-
-
MDEV-24616 JSON_EXTRACT produces incorrect result for double wildcard
-
- Open
-
- relates to
-
MDEV-12131 JSON path as used by MariaDB 10.2 JSON needs documentation
-
- Closed
-