[MCOL-4234] ORDER BY clause if not included in the GROUP BY clause fails Created: 2020-08-05  Updated: 2024-02-04

Status: Stalled
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 6.3.1
Fix Version/s: 23.10

Type: Bug Priority: Critical
Reporter: susil.behera Assignee: Sergey Zefirov
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Server version: 10.5.5-MariaDB MariaDB Server
Columnstore: 1.5.4-1


Issue Links:
Duplicate
is duplicated by MCOL-5249 Reading a Columnstore table via a vie... Confirmed
Sprint: 2023-11, 2023-12

 Description   

ORDER BY clause if not included in the GROUP BY clause fails on Columnstore.

Repro -
DROP TABLE IF EXISTS t1, t2;

CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
score smallint(5) unsigned,
date date
) ENGINE=Columnstore;

INSERT INTO t1 VALUES (1,1,1,'','0000-00-00');

CREATE TABLE t2 (
userID int(10) unsigned NOT NULL,
niName char(15)
) ENGINE=Columnstore;

INSERT INTO t2 VALUES (1,'name');

SELECT t1.spID, t2.userid, MIN(t1.score)
FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid, t1.spID ORDER BY t1.date;
ERROR 1815 (HY000): Internal error: IDB-2021: 'test.t1.date' 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.

On Innodb
------------
SELECT t1.spID, t2.userid, MIN(t1.score)
-> FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid, t1.spID ORDER BY t1.date;
Empty set (0.001 sec)


Generated at Thu Feb 08 02:48:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.