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

Nested JSON_ARRAYAGG in JSON_OBJECT should not get escaped

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5.1
    • 10.5.4
    • JSON, Server
    • None

    Description

      When running this query:

      select json_object('x', json_arrayagg(json_object('a', 1)));
      

      I'm getting this content (with the JSON_ARRAYAGG content being embedded in a string).

      {"x": [{"a": 1}]}
      

      I'm expecting this instead:

      {"x": "[{\"a\": 1}]"}
      

      I'm getting the expected result in MySQL or in Oracle. In the case of Oracle, use this syntax for comparison:

      select json_object('x' value json_arrayagg(json_object('a' value 1))) from dual;
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              lukas.eder Lukas Eder
              Votes:
              1 Vote for this issue
              Watchers:
              3 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.