1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #24605 -- Fixed incorrect reference to alias in subquery.

Thanks to charettes and priidukull for investigating the issue, and to
kurevin for the report.
This commit is contained in:
Anssi Kääriäinen
2015-04-16 08:39:31 +03:00
committed by Tim Graham
parent 8ca9bc5ec3
commit 355c5edd93
5 changed files with 55 additions and 9 deletions

View File

@@ -347,7 +347,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)