summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-10-22 13:29:12 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-10-22 13:29:12 -0400
commit0c9d55db73776d12a6898929092a42e586f3c4bf (patch)
tree106acd13b92679374af143d7a1cdc79344f77e00 /lib/sqlalchemy/sql/compiler.py
parentbd8ccf436cbf9e1250bb026ae2193bad47468984 (diff)
downloadsqlalchemy-0c9d55db73776d12a6898929092a42e586f3c4bf.tar.gz
The auto-correlation feature of :func:`.select`, and
by proxy that of :class:`.orm.Query`, will not take effect for a SELECT statement that is being rendered directly in the FROM list of the enclosing SELECT. Correlation in SQL only applies to column expressions such as those in the WHERE, ORDER BY, columns clause. [ticket:2595]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 5fe30a8ff..6da51c31c 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1072,7 +1072,12 @@ class SQLCompiler(engine.Compiled):
positional_names=None, **kwargs):
entry = self.stack and self.stack[-1] or {}
- existingfroms = entry.get('from', None)
+ if not asfrom:
+ existingfroms = entry.get('from', None)
+ else:
+ # don't render correlations if we're rendering a FROM list
+ # entry
+ existingfroms = []
froms = select._get_display_froms(existingfroms)