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

JSON_ARRAYAGG does not skip NULL by default

    XMLWordPrintable

Details

    Description

      The standard for `JSON_ARRAYAGG` has an implicit default value of `ABSENT ON NULL`. MariaDB does not implicitly apply this option, and applies `NULL ON NULL` as the incorrect default:

      See:

      Note, MySQL is also has a bugged approach:

      The immediate fix is to just change this to true.

      bool skip_nulls() const override { return false; }

      https://github.com/MariaDB/server/blob/ecc7961140968b3a9d464b65786bb3a3ca92bb42/sql/item_jsonfunc.h#L716

      Adding support for `NULL_ON_NULL` and `ABSENT_ON_NULL` could be added on separately.

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            ShortFuse Carlos Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.