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

SQL/JSON path doesn't unwrap

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.7, 10.4, 10.5
    • 10.4, 10.5
    • JSON
    • None

    Description

      SQL/JSON path lax mode (default) requires unwrapping arrays in several cases, out of which MariaDB only supports the member accessor and wildcard member accessor (SQL-2:2016 3.39 General Rule 11 g 1 B I and 2 A I).

      MariaDB doesn't do that.

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

      This should basically work like this:

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

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            Markus Winand Markus Winand
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.