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

json_search returns incorrect result when keys contain dots

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2.22, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL)
    • 10.6
    • JSON
    • None

    Description

      The query:

      SELECT json_search('{"19.50":{"20.50":[1,{"a":6}]}}','one',6)
      

      returns this:

      "$.19.50.20.50[1].a"
      

      But when you try:

      SELECT json_value('{"19.50":{"20.50":[1,{"a":6}]}}',"$.19.50.20.50[1].a")
      

      you get NULL.

      Correct answer for the json_search query, would be:

      '$."19.50"."20.50"[1]."a"'
      

      Tested on 10.2.22 OS: centos 7

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            m-dolev Moshe Dolev
            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.