mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Update django/db/models/sql/compiler.py
Co-authored-by: Lily Foote <code@lilyf.org>
This commit is contained in:
parent
c462ade332
commit
fc31ef885d
@ -2093,12 +2093,12 @@ class SQLUpdateCompiler(SQLCompiler):
|
||||
class SQLBulkUpdateCompiler(SQLCompiler):
|
||||
def execute_sql(self, result_type):
|
||||
cursor = super().execute_sql(result_type)
|
||||
if not cursor:
|
||||
return 0
|
||||
try:
|
||||
rows = cursor.rowcount if cursor else 0
|
||||
return cursor.rowcount
|
||||
finally:
|
||||
if cursor:
|
||||
cursor.close()
|
||||
return rows
|
||||
cursor.close()
|
||||
|
||||
def get_update_clause(self, values):
|
||||
qn = self.quote_name_unless_alias
|
||||
|
Loading…
Reference in New Issue
Block a user