mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user