mirror of
https://github.com/django/django.git
synced 2025-12-02 00:01:29 +00:00
Refs #20939 -- Moved subquery ordering clearing optimization to the __in lookup.
Queries could potentially be resolved in cases where ordering matter.
This commit is contained in:
parent
8095496a1c
commit
e62ea0bb9c
2 changed files with 12 additions and 9 deletions
|
|
@ -981,12 +981,6 @@ class Query:
|
|||
# Subqueries need to use a different set of aliases than the outer query.
|
||||
clone.bump_prefix(query)
|
||||
clone.subquery = True
|
||||
# It's safe to drop ordering if the queryset isn't using slicing,
|
||||
# distinct(*fields) or select_for_update().
|
||||
if (self.low_mark == 0 and self.high_mark is None and
|
||||
not self.distinct_fields and
|
||||
not self.select_for_update):
|
||||
clone.clear_ordering(True)
|
||||
return clone
|
||||
|
||||
def prepare_lookup_value(self, value, lookups, can_reuse, allow_joins=True):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue