#31679: Django subtly produces incorrect query when the same keyword appears in
both aggregate() and annotate()
-------------------------------------+-------------------------------------
Reporter: StefanosChaliasos | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"1297c0d0d76a708017fe196b61a0ab324df76954" 1297c0d]:
{{{
#!CommitTicketReference repository=""
revision="1297c0d0d76a708017fe196b61a0ab324df76954"
Fixed #31679 -- Delayed annotating aggregations.
By avoiding to annotate aggregations meant to be possibly pushed to an
outer query until their references are resolved it is possible to
aggregate over a query with the same alias.
Even if #34176 is a convoluted case to support, this refactor seems
worth it given the reduction in complexity it brings with regards to
annotation removal when performing a subquery pushdown.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31679#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070184a5a5e45b-0804ef13-e758-4a44-9464-41cf556fcbd7-000000%40eu-central-1.amazonses.com.