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

JSON_EXTRACT returns wrong result with **

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.6, 12.3
    • 10.11, 11.4, 11.8, 12.3
    • 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

        Issue Links

          Activity

            People

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