summaryrefslogtreecommitdiff
path: root/django/db/models/sql/where.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/where.py')
-rw-r--r--django/db/models/sql/where.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
index 795eff8395..2577e1d7a5 100644
--- a/django/db/models/sql/where.py
+++ b/django/db/models/sql/where.py
@@ -239,6 +239,7 @@ class SubqueryConstraint:
self.alias = alias
self.columns = columns
self.targets = targets
+ query_object.clear_ordering(clear_default=True)
self.query_object = query_object
def as_sql(self, compiler, connection):