Opened 3 years ago

Closed 3 years ago

#32546 closed Bug (fixed)

Meta.ordering fields must not be included in GROUP BY clause

Reported by: Yuri Konotopov Owned by: Yuri Konotopov
Component: Database layer (models, ORM) Version: 3.1
Severity: Normal Keywords:
Cc: Simon Charette Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This continues (closed) [1] ticket.

I beleave it was not properly fixed in commit [0ddb4ebf].
While commit [0ddb4ebf] removes ORDER BY when Meta.ordering is used it still does populates GROUP BY with Meta.ordering fields thus leads to wrong aggregation.
PR with test case was added at [2].

[1] https://code.djangoproject.com/ticket/14357
[2]https://github.com/django/django/pull/14122

Change History (4)

comment:1 by Mariusz Felisiak, 3 years ago

Cc: Simon Charette added
Needs tests: set
Owner: changed from nobody to Yuri Konotopov
Patch needs improvement: set
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 by Mariusz Felisiak, 3 years ago

Needs tests: unset

comment:3 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 330bc40:

Fixed #32546 -- Avoided Meta.ordering columns in GROUP BY clauses.

Follow up to 0ddb4ebf7bfcc4730c80a772dd146a49ef6895f6.

Note: See TracTickets for help on using tickets.
Back to Top