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

JSON path expression with dashes doesn't work

    XMLWordPrintable

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

            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.