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:
Simon Charette 2017-04-26 23:20:04 -04:00
parent 8095496a1c
commit e62ea0bb9c
2 changed files with 12 additions and 9 deletions

View file

@ -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):