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

SQL/JSON path: array wildcard accessor (.[*]) doesn't wrap

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.7
    • 10.6
    • JSON
    • None

    Description

      In SQL/JSON Path lax mode (default), the array accessor [...] as well as the wildcard array accessor [*] wrap non-array values (SQL-2:2016 9.39 General Rule 11 g 3 A and 4 A).

      MariaDB only wraps for the regular array accessor:

      MariaDB 5.5.5-10.4.7-MariaDB> select json_value('{"a": 1}', '$.a[0]');
      +----------------------------------+
      | json_value('{"a": 1}', '$.a[0]') |
      +----------------------------------+
      | 1                                |
      +----------------------------------+
      1 row in set (0.00 sec)
       
      MariaDB 5.5.5-10.4.7-MariaDB> select json_value('{"a": 1}', '$.a[*]');
      +----------------------------------+
      | json_value('{"a": 1}', '$.a[*]') |
      +----------------------------------+
      | NULL                             |
      +----------------------------------+
      1 row in set (0.00 sec)

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            Markus Winand Markus Winand
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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