summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorLuke Cyca <me@lukecyca.com>2013-03-07 11:56:11 -0800
committerLuke Cyca <me@lukecyca.com>2013-03-07 11:56:11 -0800
commitf122a307e03d9a1f2322b35429972a5f928d5b30 (patch)
tree7eed4eee764516a8310ac5bf6e3a78639b6cb295 /lib/sqlalchemy/sql/compiler.py
parent3b7fbdb2962439438c38e972843d3c8ef05eb216 (diff)
downloadsqlalchemy-f122a307e03d9a1f2322b35429972a5f928d5b30.tar.gz
Changed behavior of Select.correlate() to ignore correlations to froms that don't exist in the superquery.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 59e46de12..90e906727 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1086,14 +1086,9 @@ class SQLCompiler(engine.Compiled):
positional_names=None, **kwargs):
entry = self.stack and self.stack[-1] or {}
- if not asfrom:
- existingfroms = entry.get('from', None)
- else:
- # don't render correlations if we're rendering a FROM list
- # entry
- existingfroms = []
+ existingfroms = entry.get('from', None)
- froms = select._get_display_froms(existingfroms)
+ froms = select._get_display_froms(existingfroms, asfrom=asfrom)
correlate_froms = set(sql._from_objects(*froms))