summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-08-22 10:42:10 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-08-22 10:51:07 +0300
commit8d65b6082c8bf5df25608d8733470879a8a61d7d (patch)
tree54a9d5c541e01c42254924f0b9fa30cdf64b14d4 /django
parentc5f768f8cc53a54686bcb1867cc4400393427ffe (diff)
Fixed #20955 -- select_related regression
In cases where the same connection (from model A to model B along the same field) was needed multiple times in a select_related query, the join setup code mistakenly reused an existing join.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/sql/compiler.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index caaeaefa6e..6c8b850c84 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -664,9 +664,8 @@ class SQLCompiler(object):
# Use True here because we are looking at the _reverse_ side of
# the relation, which is always nullable.
new_nullable = True
- table = model._meta.db_table
- self.fill_related_selections(model._meta, table, cur_depth + 1,
- next, restricted, new_nullable)
+ self.fill_related_selections(model._meta, alias, cur_depth + 1,
+ next, restricted, new_nullable)
def deferred_to_columns(self):
"""