summaryrefslogtreecommitdiff
path: root/docs/releases/5.2.9.txt
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2025-11-24 06:14:38 -0500
committerGitHub <noreply@github.com>2025-11-24 12:14:38 +0100
commit2a6e0bd72d4a69725b957d6748a4b834f21b12b5 (patch)
treec7d7b694d8a4513ab898055e884783f390a7f5ec /docs/releases/5.2.9.txt
parent57c50d8c1996733cef45204ea069a2c01b2860cc (diff)
Fixed #36751 -- Fixed empty filtered aggregation crash over annotated queryset.
Regression in b8e5a8a9a2a767f584cbe89a878a42363706f939. Refs #36404. The replace_expressions method was innapropriately dealing with falsey but not None source expressions causing them to also be potentially evaluated when __bool__ was invoked (e.g. QuerySet.__bool__ evaluates the queryset). The changes introduced in b8e5a8a9a2, which were to deal with a similar issue, surfaced the problem as aggregation over an annotated queryset requires an inlining (or pushdown) of aggregate references which is achieved through replace_expressions. In cases where an empty Q object was provided as an aggregate filter, such as when the admin facetting feature was used as reported, it would wrongly be turned into None, instead of an empty WhereNode, causing a crash at aggregate filter compilation. Note that the crash signature differed depending on whether or not the backend natively supports aggregate filtering (supports_aggregate_filter_clause) as the fallback, which makes use Case / When expressions, would result in a TypeError instead of a NoneType AttributeError. Thanks Rafael Urben for the report, Antoliny and Youngkwang Yang for the triage.
Diffstat (limited to 'docs/releases/5.2.9.txt')
-rw-r--r--docs/releases/5.2.9.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/releases/5.2.9.txt b/docs/releases/5.2.9.txt
index 588c278be5..515b233b8a 100644
--- a/docs/releases/5.2.9.txt
+++ b/docs/releases/5.2.9.txt
@@ -16,3 +16,7 @@ Bugfixes
* Fixed a bug in Django 5.2 on PostgreSQL where ``bulk_create()`` did not apply
a field's custom query placeholders (:ticket:`36748`).
+
+* Fixed a regression in Django 5.2.2 that caused a crash when using aggregate
+ functions with an empty ``Q`` filter over a queryset with annotations
+ (:ticket:`36751`).