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

insert.. select * from (subselect) throw "is not in GROUP BY clause" , even if it is part of group by clause

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.3
    • 5.6.1
    • N/A
    • None
    • 2020-7, 2021-5

    Description

      Testcase to reproduce:

      drop table if exists `I1`;
      drop table if exists `C2`;
       
       
       
       CREATE TABLE `I1` (
        `id` int(11) DEFAULT NULL,
        `intc` int(11) DEFAULT NULL
       
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
       
       
      CREATE TABLE `C2` (
        `intc` int(6) DEFAULT NULL,
      `id` int(11) NOT NULL,
       `mm_prezzo` decimal(12,0) DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
       
       
      INSERT INTO I1
      select * from (SELECT id,intc
      FROM C2
      WHERE  intc IN (201909)
      GROUP BY id,intc) as sel1;
      

      Cause:

      ERROR 1815 (HY000): Internal error: IDB-2021: 'intc' 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.
      

      The select works without insert part,
      It works ,without where condition "WHERE intc IN (201909)"
      It works with opposite order in group by ("intc,id" instead "id,intc")

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              Richard Richard Stracke
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.