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

View created via JSON_ARRAYAGG returns incorrect json object

Details

    Description

      Case repeats only in 10.5:

      Test case:

      CREATE VIEW v1 AS SELECT JSON_OBJECT(_LATIN1 'plugin', _LATIN1'unix_socket') as v1_json;
      SELECT JSON_ARRAYAGG(v1_json) FROM v1;
      DROP VIEW v1;
       
      CREATE VIEW v1 AS SELECT JSON_OBJECT('plugin','unix_socket') as v1_json;
      SELECT JSON_ARRAYAGG(v1_json) FROM v1;
      DROP VIEW v1;
      

      Expected result:

      JSON_ARRAYAGG(v1_json)
      [{"plugin": "unix_socket"}]
       
      JSON_ARRAYAGG(v1_json)
      [{"plugin": "unix_socket"}]
      

      Actual result:

      JSON_ARRAYAGG(v1_json)
      ["{\"plugin\": \"unix_socket\"}"]
       
      JSON_ARRAYAGG(v1_json)
      ["{\"plugin\": \"unix_socket\"}"]
      

      Attachments

        Issue Links

          Activity

            rucha174 Rucha Deodhar added a comment - https://github.com/MariaDB/server/commit/4930fb3fd0497fbc916c637ff4546b5e7fb183c8

            julien.fritsch, only 10.5 was affected.
            The problem was fixed earlier in 10.6. This commit backported the fix from 10.6 to 10.5.

            bar Alexander Barkov added a comment - julien.fritsch , only 10.5 was affected. The problem was fixed earlier in 10.6. This commit backported the fix from 10.6 to 10.5.

            People

              bar Alexander Barkov
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.