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

Make JSON_EXTRACT validate non-existing keys

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.9
    • Component/s: JSON, Server
    • Labels:
      None

      Description

      MariaDB [(none)]> select json_extract(json_object("key1","val1", "key2", "val2"), '$.key1','$.x','$.key2');
      +-----------------------------------------------------------------------------------+
      | json_extract(json_object("key1","val1", "key2", "val2"), '$.key1','$.x','$.key2') |
      +-----------------------------------------------------------------------------------+
      | ["val1", "val2"]                                                                  |
      +-----------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
      

      If we don't know the path arguments are valid or not we can not say to what arguments result of above query corresponds to key1 or key2 or key1 or x , or any of 8 combination.

      If there is a chance to generate NULL as a result per index in path argument, that would be great.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            anel Anel Husakovic
            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.