diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-01 10:12:50 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-01 10:12:50 +0000 |
| commit | 4fd359253d6538c6c418d23153ddb57cb1a48d17 (patch) | |
| tree | 83cf1b386587da499b4581432a68b373936486fa /django/db/models/sql/query.py | |
| parent | a75de3f3429654271ab63fddab1a8b13440a00de (diff) | |
Modified [7760] to not include a "col is not NULL" fragment for non-nullable 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: http://code.djangoproject.com/svn/django/trunk@7812 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 6c06609969..6eccaf997e 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1131,7 +1131,7 @@ class Query(object): entry.negate() self.where.add(entry, AND) break - 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. |
