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

JSON_EXTRACT returns wrong result with **

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4
    • 10.4
    • JSON
    • None

    Description

      set @json_doc3 =
      '
      {
        "root": {
           "child1" : {
             "child2" : {
               "child1" : {
                 "x":124
                }
              }
            }
         }
      }
      ';
      

      MariaDB [test]> select json_extract(@json_doc3, '$**.child1**.x');
      +--------------------------------------------+
      | json_extract(@json_doc3, '$**.child1**.x') |
      +--------------------------------------------+
      | NULL                                       |
      +--------------------------------------------+
      

      This should not return NULL.

      One can debate whether this should return the value of x once (because the document has just one x node) or twice (because there are two ways to match the pattern).

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.