Incorrect QoQ results when ordering aggregate selecft

Description

Adding ORDER BY to aggregate QOQ select without GROUP BY where the ordered column is not part of the select list causes the result to group on the additional column instead of getting a single row back.

Ex:

testQuery = queryNew("amount, relatedData, unrelateddata","integer, varchar, integer"); testQuery.addRow({amount: 1, relatedData: "a", unrelateddata: 1}); testQuery.addRow({amount: 2, relatedData: "a", unrelateddata: 2}); testQuery.addRow({amount: 3, relatedData: "a", unrelateddata: 3}); // should produce a single row queryExecute(" select sum(amount) from testQuery where 1=1 order by unrelatedData ", {}, {dbtype="query"});

See: https://dev.lucee.org/t/possible-bug-qoq-aggregate-issue-when-using-where-and-order-by/14095/3

Environment

None

Activity

Pothys - MitrahSoft 
12 August 2024 at 06:02

I've checked this ticket with the Lucee fixed version 6.2.0.41-SNAPSHOT, and the issue is now resolved. The ordering of the aggregate QOQ works correctly.

Zac Spitzer 
19 July 2024 at 10:03

PRs failing to to the docker creds problem, thanks for the PR, you need to add some docker login creds to your repo

https://luceeserver.atlassian.net/browse/LDEV-4979 (help wanted, if you have any idea how to solve!)

there was a typo in the test case, i have fixed it

https://github.com/lucee/Lucee/pull/2403/commits/4995a00939e8fad1876a7720997b0b39aa9fb80f

running the PR locally, all tests pass

Brad Wood 
18 July 2024 at 19:14

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 18 July 2024 at 19:06
Updated 12 August 2024 at 06:02
Resolved 12 August 2024 at 06:02