mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31624 -- Avoided subquery usage on QuerySet.all().delete().
Thanks Adam Johnson for the report.
Regression in 7acef095d7.
This commit is contained in:
committed by
Mariusz Felisiak
parent
437196da9a
commit
972000420e
@@ -1407,6 +1407,8 @@ class SQLInsertCompiler(SQLCompiler):
|
||||
class SQLDeleteCompiler(SQLCompiler):
|
||||
@cached_property
|
||||
def single_alias(self):
|
||||
# Ensure base table is in aliases.
|
||||
self.query.get_initial_alias()
|
||||
return sum(self.query.alias_refcount[t] > 0 for t in self.query.alias_map) == 1
|
||||
|
||||
def _as_sql(self, query):
|
||||
|
||||
Reference in New Issue
Block a user