mirror of
https://github.com/django/django.git
synced 2025-11-27 13:55:26 +00:00
Fixed #34464 -- Fixed queryset aggregation over group by reference.
Regression in 59bea9efd2.
Refs #28477.
Thanks Ian Cubitt for the report.
This commit is contained in:
parent
1c7aed71ec
commit
9daf8b4109
3 changed files with 13 additions and 0 deletions
|
|
@ -453,6 +453,9 @@ class Query(BaseExpression):
|
|||
# filtering against window functions is involved as it
|
||||
# requires complex realising.
|
||||
annotation_mask = set()
|
||||
if isinstance(self.group_by, tuple):
|
||||
for expr in self.group_by:
|
||||
annotation_mask |= expr.get_refs()
|
||||
for aggregate in aggregates.values():
|
||||
annotation_mask |= aggregate.get_refs()
|
||||
inner_query.set_annotation_mask(annotation_mask)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue