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

JSON path expression with dashes doesn't work

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.9.4
    • N/A
    • N/A
    • Tested on Windows but would assume it affects all platforms

    Description

      According to https://mariadb.com/kb/en/jsonpath-expressions/ a path expression with special characters can be quoted as shown below. But doing so returns NULL rather than the JSON data it should. Example is hierarchy from a Chrome Lighthouse report.

      SET @json = '{"audits":{"first-contentful-paint":{}}}' ;
       
      SELECT
      JSON_VALID(@json),
      JSON_QUERY(
      	@json,
      	'$.audits'
      ),
      JSON_QUERY(
      	@json,
      	'$.audits."first-contentful-paint"'
      ),
      1;
      

      Attachments

        Issue Links

          Activity

            The below had previously worked in 10.6

            JSON_QUERY(
             
            	@json,
             
            	'$.audits.first-contentful-paint'
             
            )
            

            noyearzero Ryan Leadenham added a comment - The below had previously worked in 10.6 JSON_QUERY(   @json,   '$.audits.first-contentful-paint'   )
            alice Alice Sherepa added a comment -

            Thank you! This is the same bug as MDEV-29586, so I will close the report.

            alice Alice Sherepa added a comment - Thank you! This is the same bug as MDEV-29586 , so I will close the report.

            People

              Unassigned Unassigned
              noyearzero Ryan Leadenham
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.