mirror of
https://github.com/django/django.git
synced 2025-09-27 04:29:17 +00:00
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/trunk@10913 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
be907bcdcb
commit
2416e5fefe
4 changed files with 78 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue