diff options
| author | Anssi Kääriäinen <anssi.kaariainen@thl.fi> | 2015-04-16 08:39:31 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-16 09:31:29 -0400 |
| commit | 581afddc77ccd2e343d51ede5deb33bbcf113ab2 (patch) | |
| tree | 959559ad388c87dd80842ef50928bff22d5555b4 /django | |
| parent | 1e594b257e74f60292ca421f9df11d5fd7804ea6 (diff) | |
[1.8.x] Fixed #24605 -- Fixed incorrect reference to alias in subquery.
Thanks to charettes and priidukull for investigating the issue, and to
kurevin for the report.
Backport of 355c5edd9390caad5725375abca03460805f663b from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/sql/compiler.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index a695025167..810031f47e 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -338,7 +338,8 @@ class SQLCompiler(object): if name in self.quote_cache: return self.quote_cache[name] if ((name in self.query.alias_map and name not in self.query.table_map) or - name in self.query.extra_select or name in self.query.external_aliases): + name in self.query.extra_select or ( + name in self.query.external_aliases and name not in self.query.table_map)): self.quote_cache[name] = name return name r = self.connection.ops.quote_name(name) |
