Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
N/A
-
None
Description
JSON_TABLE KB page shows PATH word in NESTED PATH column specification as optional (in 2 places):
column:
<...>
NESTED [PATH] path COLUMNS (column_list)
But in fact it doesn't work without PATH:
With PATH, 10.7 d552e092c9 |
MariaDB [test]> select * from json_table(@json, '$[*]' |
-> columns(
|
-> name varchar(10) path '$.name', |
-> nested path '$.sizes[*]' columns ( |
-> size varchar(32) path '$' |
-> )
|
-> )
|
-> ) as jt; |
Empty set (0.001 sec) |
Without PATH |
MariaDB [test]> select * from json_table(@json, '$[*]' |
-> columns(
|
-> name varchar(10) path '$.name', |
-> nested '$.sizes[*]' columns ( |
-> size varchar(32) path '$' |
-> )
|
-> )
|
-> ) as jt; |
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''$.sizes[*]' columns ( |
size varchar(32) path '$' |
)
|
)
|
) as jt' at line 4 |
Also, there is an extra item in PATH column description:
column:
<...>
name type PATH value_path path [on_empty] [on_error]
<...>
It is either value_path or path, whichever is correct, but not both.
The second occurrence of the syntax on the same page correctly shows only one:
name type PATH value_path [on_empty] [on_error]