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

Wrong result from JSON native function.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2.6
    • 10.2.9
    • JSON
    • None
    • Windows 10

    Description

      It seems that JSON functions fail to get returned result from another function:

      select json_extract(json_object('truc',json_array('machin',4,json_object('chose','XML'))),'$.truc[2].chose') as result;
      +--------+
      | result |
      +--------+
      | "XML"  |
      +--------+
       
      select json_search(json_object('truc',json_array('machin',4,json_object('chose','XML'))),'one','XML') as Path;
      +-------------------+
      | Path              |
      +-------------------+
      | "$.truc[2].chose" |
      +-------------------+
       
      select json_extract(json_object('truc',json_array('machin',4,json_object('chose','XML'))),json_search(json_object('truc',json_array('machin',4,json_object('chose','XML'))),'one','XML')) as Result;
      +--------+
      | Result |
      +--------+
      | NULL   |
      +--------+
      

      Sould not the last query return "XML"?

      Attachments

        Issue Links

          Activity

            bertrandop Olivier Bertrand created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Status Open [ 1 ] Confirmed [ 10101 ]
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            Assignee Alexey Botchkov [ holyfoot ]
            holyfoot Alexey Botchkov made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            holyfoot Alexey Botchkov made changes -
            issue.field.resolutiondate 2017-09-12 21:05:04.0 2017-09-12 21:05:04.939
            holyfoot Alexey Botchkov made changes -
            Fix Version/s 10.2.9 [ 22611 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            greenman Ian Gilfillan made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 80897 ] MariaDB v4 [ 152205 ]

            People

              holyfoot Alexey Botchkov
              bertrandop Olivier Bertrand
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.