From 8ebdd37a0b1755842baae3bd34d388156ad4bf53 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 2 Apr 2025 13:32:38 -0400 Subject: [5.2.x] Fixed #36290 -- Made TupleIn() lookup discard tuples containing None. Just like the In() lookup discards of None members TupleIn() should discard tuples containing any None as NULL != NULL in SQL and the framework expects such queries to be elided under some circumstances. Refs #31667, #36116. Thanks Basptise Mispelon for bisecting the regression to 626d77e. Backport of f7f38f3a0b44d8c6d14344dae66b6ce52cd77b55 from main --- docs/releases/5.2.1.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/releases/5.2.1.txt b/docs/releases/5.2.1.txt index a4e73841bd..b17e63ebd1 100644 --- a/docs/releases/5.2.1.txt +++ b/docs/releases/5.2.1.txt @@ -12,3 +12,6 @@ Bugfixes * Fixed a regression in Django 5.2 that caused a crash when annotating aggregate expressions over query that uses explicit grouping by transforms followed by field references (:ticket:`36292`). + +* Fixed a regression in Django 5.2 that caused unnecessary queries when + prefetching nullable foreign key relationships (:ticket:`36290`). -- cgit v1.3