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

JSON_TABLE: A space between JSON_TABLE and opening bracket causes syntax error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.6.0
    • Component/s: JSON, Parser
    • Labels:
      None

      Description

      select * from json_table ('{}', '$' COLUMNS(x FOR ORDINALITY)) a;
      

      bb-10.6-mdev17399-psergey2 8b533cc1d5

      MariaDB [db]> select * from json_table ('{}', '$' COLUMNS(x FOR ORDINALITY)) a;
      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 '('{}', '$' COLUMNS(x FOR ORDINALITY)) a' at line 1
      

      It works in MySQL:

      MySQL 8.0.23

      MySQL [db]> select * from json_table ('{}', '$' COLUMNS(x FOR ORDINALITY)) a;
      +------+
      | x    |
      +------+
      |    1 |
      +------+
      1 row in set (0.001 sec)
      

      Given the expected complexity of statements involving JSON_TABLE, I think it's important to allow for pretty multi-line formatting of all sorts (it's not the same as having this limitation for a simple single-argument function like COUNT).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: