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

JSON_EXTRACT returns data for invalid JSON

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.2.5
    • 10.2.9
    • JSON
    • None
    • Linux CentOS 6.4

    Description

      The function JSON_EXTRACT will return data and will not raise an error, even if the provided JSON is invalid JSON. It will not check the whole thing, so if the JSON up to the point of the provided JSON path is correct, that will be returned, even if the rest of the JSON data is invalid. For example

      MariaDB [(none)]> select JSON_EXTRACT('{"foo": "bar" foobar foo invalid ', '$.foo');
      +------------------------------------------------------------+
      | JSON_EXTRACT('{"foo": "bar" foobar foo invalid ', '$.foo') |
      +------------------------------------------------------------+
      | "bar"                                                      |
      +------------------------------------------------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Activity

          karlsson Anders Karlsson 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 07:51:15.0 2017-09-12 07:51:15.129
          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 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 81069 ] MariaDB v4 [ 152263 ]

          People

            holyfoot Alexey Botchkov
            karlsson Anders Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.