From dc449e9664ff89b2acab9934a5589e04061dc4ec Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 30 Jul 2010 04:07:27 +0000 Subject: [PATCH] [1.2.X] Fixed #13882 -- Removed an unnecessary nested where clause introduced on __isnull queries. Thanks to Alex Gaynor for the report and patch. Backport of r13456 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13457 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/query.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 0913399e2a..ec477447f3 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1090,10 +1090,7 @@ class Query(object): # exclude the "foo__in=[]" case from this handling, because # it's short-circuited in the Where class. # We also need to handle the case where a subquery is provided - entry = self.where_class() - entry.add((Constraint(alias, col, None), 'isnull', True), AND) - entry.negate() - self.where.add(entry, AND) + self.where.add((Constraint(alias, col, None), 'isnull', False), AND) if can_reuse is not None: can_reuse.update(join_list)