Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4.7, 10.4, 10.5
-
None
Description
SQL/JSON path lax mode (default) requires unwrapping arrays in several cases, out of which MariaDB only supports the member accessor and wildcard member accessor (SQL-2:2016 3.39 General Rule 11 g 1 B I and 2 A I).
MariaDB doesn't do that.
MariaDB 5.5.5-10.4.7-MariaDB> select json_value('{"a": [{"b": 9}]}', '$.a.b');
|
+------------------------------------------+
|
| json_value('{"a": [{"b": 9}]}', '$.a.b') |
|
+------------------------------------------+
|
| NULL |
|
+------------------------------------------+
|
1 row in set (0.00 sec)
|
This should basically work like this:
MariaDB 5.5.5-10.4.7-MariaDB> select json_value('{"a": [{"b": 9}]}', '$.a[*].b');
|
+---------------------------------------------+
|
| json_value('{"a": [{"b": 9}]}', '$.a[*].b') |
|
+---------------------------------------------+
|
| 9 |
|
+---------------------------------------------+
|
1 row in set (0.00 sec)
|