summaryrefslogtreecommitdiff
path: root/django/db/models/query.py
diff options
context:
space:
mode:
authorChris Cahoon <chris.cahoon@gmail.com>2009-06-13 03:28:54 +0000
committerChris Cahoon <chris.cahoon@gmail.com>2009-06-13 03:28:54 +0000
commitcb847aa2249d10b14ec53e419f4610e4e7d08811 (patch)
treeb9bed0e030d8c0d7b7035524941b78a27547a308 /django/db/models/query.py
parentae2dd58ab12a59dc6459f5ff685639f8268de4da (diff)
Fixed #9479 -- Corrected an edge case in bulk queryset deletion that could cause an infinite loop when using MySQL InnoDB.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/query.py')
-rw-r--r--django/db/models/query.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 6a8d7d5e64..0d35b0ba16 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -355,10 +355,11 @@ class QuerySet(object):
# Delete objects in chunks to prevent the list of related objects from
# becoming too long.
+ seen_objs = None
while 1:
# Collect all the objects to be deleted in this chunk, and all the
# objects that are related to the objects that are to be deleted.
- seen_objs = CollectedObjects()
+ seen_objs = CollectedObjects(seen_objs)
for object in del_query[:CHUNK_SIZE]:
object._collect_sub_objects(seen_objs)