mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Fixed #19720 -- Oracle ordering related delete regression
When a query had a complex where condition (a condition targeting more
than the base table) a subquery was used for deletion. However, the
query had default ordering from the model's meta and Oracle doesn't
work with ordered subqueries.
The regression was caused by fast-path deletion code introduced in
1cd6e04cd4
for fixing #18676.
Thanks to Dylan Klomparens for the report.
This commit is contained in:
parent
0478780b8e
commit
8ef3235034
3 changed files with 23 additions and 2 deletions
|
@ -539,7 +539,7 @@ class QuerySet(object):
|
|||
# Disable non-supported fields.
|
||||
del_query.query.select_for_update = False
|
||||
del_query.query.select_related = False
|
||||
del_query.query.clear_ordering()
|
||||
del_query.query.clear_ordering(force_empty=True)
|
||||
|
||||
collector = Collector(using=del_query.db)
|
||||
collector.collect(del_query)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue