summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-12-13 23:46:41 -0500
committerSimon Charette <charette.s@gmail.com>2015-12-14 13:13:47 -0500
commitc402db2e2f3315dc3292526a6bdae36630026dfe (patch)
treee83c4b314783267aee3a58fa7e6c6d6cd60655ca /django/db/models/sql
parent45ea00742b06393a76f2d553999a5c37e09dc7c3 (diff)
[1.9.x] Fixed #25882 -- Prevented fast deletes matching no rows from crashing on MySQL.
Thanks to Trac aliases gerricom for the report, raphaelmerx for the attempts to reproduce and Sergey Fedoseev and Tim for the review. Refs #16891 Backport of 8035cee92293f3319919c8248c7787ba43c05917 from master
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/subqueries.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index 35c814f903..266b6a017c 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -68,7 +68,7 @@ class DeleteQuery(Query):
# We can't do the delete using subquery.
values = list(query.values_list('pk', flat=True))
if not values:
- return
+ return 0
return self.delete_batch(values, using)
else:
innerq.clear_select_clause()