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

JSON_ARRAYAGG is limited by group_concat_max_len

    XMLWordPrintable

Details

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

    Description

      set group_concat_max_len=64;
      create table t30 (a varchar(254));
      insert into t30 values (concat('x64-', repeat('a', 60)));
      insert into t30 values (concat('x64-', repeat('b', 60)));                                                                                              
      insert into t30 values (concat('x64-', repeat('c', 60)));
      

      MariaDB [test]> select json_arrayagg(a) from t30;                                                                                                                      
      +--------------------------------------------------------------------+                                                                                                 
      | json_arrayagg(a)                                                   |                                                                                                 
      +--------------------------------------------------------------------+                                                                                                 
      | ["x64-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] |
      +--------------------------------------------------------------------+
      1 row in set, 1 warning (0.002 sec)
      

      MariaDB [test]> show warnings;
      +---------+------+---------------------------------+
      | Level   | Code | Message                         |
      +---------+------+---------------------------------+
      | Warning | 1260 | Row 1 was cut by GROUP_CONCAT() |
      +---------+------+---------------------------------+
      

      This is bad on multiple levels:

      • Invalid JSON is produced (which may prevent the user application from processing it altogether)
      • The error message mentions GROUP_CONCAT, not json_arrayagg.

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.