Browse files

Modified [7760] to not include a "col is not NULL" fragment for non-n…

…ullable fields.

This avoids any use of "pk is not NULL" fragment, which behave inconsistently
in MySQL. Thanks to Russell Keith-Magee for diagnosing the problem and
suggesting the easy fix.

Refs #7076.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent a75de3f commit 4fd359253d6538c6c418d23153ddb57cb1a48d17 @malcolmt malcolmt committed Jul 1, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/sql/
@@ -1131,7 +1131,7 @@ def add_filter(self, filter_expr, connector=AND, negate=False, trim=False,
self.where.add(entry, AND)
- elif not (lookup_type == 'in' and not value):
+ elif not (lookup_type == 'in' and not value) and field.null:
# Leaky abstraction artifact: We have to specifically
# exclude the "foo__in=[]" case from this handling, because
# it's short-circuited in the Where class.

0 comments on commit 4fd3592

Please sign in to comment.