[MCOL-3890] insert.. select * from (subselect) throw "is not in GROUP BY clause" , even if it is part of group by clause Created: 2020-03-17 Updated: 2021-03-24 Resolved: 2021-03-24 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | N/A |
| Affects Version/s: | 1.4.3 |
| Fix Version/s: | 5.6.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Richard Stracke | Assignee: | Roman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Sprint: | 2020-7, 2021-5 | ||||||||||||||||||||
| Description |
|
Testcase to reproduce:
Cause:
The select works without insert part, |
| Comments |
| Comment by Roman [ 2020-03-23 ] |
|
So the issue caused by the optimization made by MDB. It removes intc b/c there is IN + single constant. If you run the query with at least two constants it works. If you switch the GROUP BY order it works b/c GROUP BY key is now 2 columns not one. There is a fix ready for this issue. Next release will both contain a workaround that enables SH for INSERT..SELECT and fix for Derived Handler. |
| Comment by Roman [ 2020-04-02 ] |
|
4 QA: you should also test: create table t2 as select * from (SELECT id,intc FROM C2 WHERE intc IN (201909) GROUP BY id,intc) as sel1; |
| Comment by Roman [ 2020-05-08 ] |
|
Had been solved in the hotfix for 1.4.3. |
| Comment by Roman [ 2020-05-08 ] |
|
The corner case(single top level subquery wrap) described by this issue fails in 1.4 and 1.5. |
| Comment by Gregory Dorman (Inactive) [ 2021-03-23 ] |
|
I just retested it and it works in 5.5.2. There was an MDEV ticket which is responsible for fixing it - but of course I can't fine it (maybe drrtuy can recover it). In either case, let's formally test it in 5.6.1 branch (5.5.2 is too late), so at lease we will be able to get it into the release notes and tell the world that it is fixed then. |
| Comment by Daniel Lee (Inactive) [ 2021-03-23 ] |
|
Build tested: 5.6.1 (Drone #1915) The issue reported in the bug description has been fixed, but another issue mentioned in the comment still exists. MariaDB [mytest]> create table t2 as select * from (SELECT id,intc FROM C2 WHERE intc IN (201909) GROUP BY id,intc) as sel1; MariaDB [mytest]> select * into outfile '/tmp/result.dml' from (SELECT id,intc FROM C2 WHERE intc IN (201909) GROUP BY id,intc) as sel1; The query would work without the outfile clause MariaDB [mytest]> select * from (SELECT id,intc FROM C2 WHERE intc IN (201909) GROUP BY id,intc) as sel1; |
| Comment by Gregory Dorman (Inactive) [ 2021-03-24 ] |
|
The original complaint has been corrected by |