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

Nested JSON_ARRAYAGG in JSON_OBJECT should not get escaped

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.1
    • Fix Version/s: 10.5.4
    • Component/s: JSON, Server
    • Labels:
      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

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              lukas.eder Lukas Eder
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: