diff options
| author | Andrew Brown <brownan@gmail.com> | 2018-07-20 14:54:14 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-07-25 18:08:57 -0400 |
| commit | 55810d94d03728dcad9f53d5b9e21565627aeade (patch) | |
| tree | 4ed3a687b7f2d8d895bb86a75c18706d1c90f396 /django | |
| parent | 4523beebb260d5cc283d31d842131da1851506ee (diff) | |
Refs #29563 -- Fixed SQLCompiler.execute_sql() to respect DatabaseFeatures.can_use_chunked_reads.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/sql/compiler.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 3b91eaa35b..66ff004b6e 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -1089,11 +1089,12 @@ class SQLCompiler: self.col_count if self.has_extra_select else None, chunk_size, ) - if not chunked_fetch and not self.connection.features.can_use_chunked_reads: + if not chunked_fetch or not self.connection.features.can_use_chunked_reads: try: # 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. Use chunked_fetch if requested. + # before going any further. Use chunked_fetch if requested, + # unless the database doesn't support it. return list(result) finally: # done with the cursor |
