From e0f14d83898ee7d0d3180eb96214d8fcdf82cc1d Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 7 Sep 2022 22:30:06 -0400 Subject: [4.1.x] Fixed #33992 -- Fixed queryset crash when aggregating over a group containing Exists. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A more in-depth solution is likely to make sure that we always GROUP BY selected annotations or revisit how we use Query.exists() in the Exists expression but that requires extra work that isn't suitable for a backport. Regression in e5a92d400acb4ca6a8e1375d1ab8121f2c7220be. Thanks Fernando Flores Villaça for the report. Backport of 32536b1324e98768dd892980408a8c6b26c23fd9 from main --- docs/releases/4.1.2.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/releases/4.1.2.txt b/docs/releases/4.1.2.txt index 4659558f3d..96c2fefcdc 100644 --- a/docs/releases/4.1.2.txt +++ b/docs/releases/4.1.2.txt @@ -11,3 +11,7 @@ Bugfixes * Fixed a regression in Django 4.1 that caused a migration crash on PostgreSQL when adding a model with ``ExclusionConstraint`` (:ticket:`33982`). + +* Fixed a regression in Django 4.1 that caused aggregation over a queryset that + contained an ``Exists`` annotation to crash due to too many selected columns + (:ticket:`33992`). -- cgit v1.3