summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index a79d66eb21..ce4fafb1e2 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -972,6 +972,8 @@ class Query(BaseExpression):
relabelling any references to them in select columns and the where
clause.
"""
+ if not change_map:
+ return self
# If keys and values of change_map were to intersect, an alias might be
# updated twice (e.g. T4 -> T5, T5 -> T6, so also T4 -> T6) depending
# on their order in change_map.