SQLite
View Ticket
Not logged in
Ticket UUID: b75a9ca6b04991dd593c472f56ce88a59d4f131c
Title: ORDER BY ignored if query has identical GROUP BY
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-04-21 13:39:44
Version Found In: 3.8.4.3
User Comments:
drh added on 2014-04-20 09:34:23:

In the query at the end of the following code, the ORDER BY clause is ignored and the results appear in the wrong order:

CREATE TABLE t1(x,y);
INSERT INTO t1 VALUES(1,1),(2,0);
CREATE INDEX t1yx ON t1(y,x);
SELECT x,y FROM t1 GROUP BY x, y ORDER BY x, y;

This problem appears to have been introduced into trunk by the cutover to the next generation query planner in check-in 0fe31f60cadc5fe5a9d on 2013-06-26.