Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26701

Typos in syntax description on JSON_TABLE KB page

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • N/A
    • N/A
    • Documentation
    • 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]

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.