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

Make JSON_EXTRACT validate non-existing keys

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11
    • JSON, Server
    • 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

            Unassigned Unassigned
            anel Anel Husakovic
            Votes:
            1 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.