Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5776

SELECT CONCAT(<cols not in GROUP BY list>) throws error: MCS-2021

    XMLWordPrintable

Details

    • Task
    • Status: In Progress (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 23.10.3
    • None
    • None
    • | Columnstore_commit_hash | 7ec8f3d-dirty |
      | Columnstore_version | 23.10.0 |
    • 2024-2

    Description

      SELECT CONCAT(<cols not in GROUP BY list>) throws error: MCS-2021.

      Repro
      ------
      CREATE TABLE t1 (
      cid mediumint(9) NOT NULL,
      firstname varchar(32) DEFAULT '' NOT NULL,
      surname varchar(32) DEFAULT '' NOT NULL
      ) ENGINE=columnstore;
      INSERT INTO t1 VALUES (1,'That','Guy');
      INSERT INTO t1 VALUES (2,'Another','Gent');

      MariaDB [testMcs]> SELECT cid, CONCAT(firstname, ' ', surname) AS fullname, COUNT FROM t1 GROUP BY cid;
      ERROR 1815 (HY000): Internal error: MCS-2021: 'fullname' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.

      But SELECT without CONCAT() works.
      MariaDB [testMcs]> SELECT cid, firstname, surname, COUNT FROM t1 GROUP BY cid;
      -----------------------------+

      cid firstname surname COUNT

      -----------------------------+

      1 That Guy 1
      2 Another Gent 1

      -----------------------------+
      2 rows in set (0.055 sec)

      Expected behavior:
      SELECT CONCAT(<cols not in GROUP BY list>) should work.

      Attachments

        Issue Links

          Activity

            People

              sergey.zefirov Sergey Zefirov
              susil.behera Susil Behera
              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.