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

Squared brackets missing from JSON_ARRAYAGG when used in a view

Details

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

    Description

      When JSON_ARRAYAGG is used in a view, querying that view results in missing [ and ] brackets.

      create or replace view dummy as (
       
        select  json_arrayagg(json_object(
                 "type", "permPeriod",
                 "id", ID
               )) as JSON_DATA
        
        from TEST
       
        group by COL1
      )
       
      select * from dummy 
      

      gives:

      {"type": "permPeriod", "id": 7},{"type": "permPeriod", "id": 8}
      

      instead of:

      [{"type": "permPeriod", "id": 7},{"type": "permPeriod", "id": 8}]
      

      Attachments

        Issue Links

          Activity

            fathert Tim Fathers created issue -
            alice Alice Sherepa made changes -
            Field Original Value New Value
            Fix Version/s 10.5 [ 23123 ]
            alice Alice Sherepa made changes -
            Affects Version/s 10.5 [ 23123 ]
            alice Alice Sherepa made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            alice Alice Sherepa made changes -
            Assignee Alexey Botchkov [ holyfoot ]
            alice Alice Sherepa made changes -
            holyfoot Alexey Botchkov made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            holyfoot Alexey Botchkov made changes -
            issue.field.resolutiondate 2020-06-04 12:58:58.0 2020-06-04 12:58:58.596
            holyfoot Alexey Botchkov made changes -
            Fix Version/s 10.5.4 [ 24264 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            alice Alice Sherepa made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 106342 ] MariaDB v4 [ 157514 ]

            People

              holyfoot Alexey Botchkov
              fathert Tim Fathers
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.