[MDEV-26701] Typos in syntax description on JSON_TABLE KB page Created: 2021-09-27  Updated: 2021-10-18  Resolved: 2021-10-18

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: 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]


Generated at Thu Feb 08 09:47:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.