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

json_arrayagg fails in certain conditions

    XMLWordPrintable

Details

    Description

      Here is the minimum list of conditions I found to trigger the issue:
      1. json_arrayAgg fails
      2. When combined with another function, like concat or quote
      3. In a subselect
      4. The column is observed in the where clause of the outer select.

      with x as ( select quote( json_arrayAgg( 1 ) ) y )
          select y from x where y > ''  # returns '[[1]]'  - bug
      union all
          select y from x;           # returns '[1]'    - correct
      

      This behaviour was observed on MariaDB versions:
      1. RDS - 11.4.5-MariaDB-log
      2. Docker - 11.7.2-MariaDB-ubu2404
      3. Docker - 11.8.1-MariaDB-ubu2404 - 11.8.1-noble-rc

      For comparison, the issue was not observed on MySQL version 9.3.0.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              dimitar@rysemarket.com Dimitar Gologanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.