1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #7411 -- worked around some possible transaction conflicts in SQLite.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-07-15 18:47:32 +00:00
parent e867c5a0cc
commit 3b37c8151a
4 changed files with 26 additions and 4 deletions

View File

@@ -1616,10 +1616,16 @@ class Query(object):
# The MULTI case.
if self.ordering_aliases:
return order_modified_iter(cursor, len(self.ordering_aliases),
result = order_modified_iter(cursor, len(self.ordering_aliases),
self.connection.features.empty_fetchmany_value)
return iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
self.connection.features.empty_fetchmany_value)
if not self.connection.features.can_use_chunked_reads:
# If we are using non-chunked reads, we return the same data
# structure as normally, but ensure it is all read into memory
# before going any further.
return list(result)
return result
# Use the backend's custom Query class if it defines one. Otherwise, use the
# default.