summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-02-10 17:59:06 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-02-10 17:59:06 -0500
commit7d693180be8c7f9db79831351751a15d786b86a7 (patch)
tree3a75257d428db339ba85ec6b4b9203144c1e9fa5 /lib/sqlalchemy/sql/util.py
parent089e9ce5978d081e9cb579b0298042a0efb57edd (diff)
downloadsqlalchemy-7d693180be8c7f9db79831351751a15d786b86a7.tar.gz
tweak for correlated subqueries here, seems to work for test_eager_relations:CorrelatedSubqueryTest but need some more testing here
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r--lib/sqlalchemy/sql/util.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 9a45a5777..511a5b0c2 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -100,7 +100,12 @@ def visit_binary_product(fn, expr):
"""
stack = []
def visit(element):
- if element.__visit_name__ == 'binary' and \
+ if isinstance(element, (expression.FromClause,
+ expression._ScalarSelect)):
+ # we dont want to dig into correlated subqueries,
+ # those are just column elements by themselves
+ yield element
+ elif element.__visit_name__ == 'binary' and \
operators.is_comparison(element.operator):
stack.insert(0, element)
for l in visit(element.left):