summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-19 19:12:40 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-19 19:12:40 -0500
commit69d1d08dc3983b2bba3ed9acafc63a7486ef29c6 (patch)
tree9a572eab6e88478a17593600b372f39b4866200b /lib/sqlalchemy/sql/compiler.py
parent25831872db7fe2a6eb07c3d50be2504b41d9d5e5 (diff)
downloadsqlalchemy-69d1d08dc3983b2bba3ed9acafc63a7486ef29c6.tar.gz
- re: #2967, also fixed a somewhat related issue where join rewriting would fail
on the columns clause of the SELECT statement if the targets were aliased tables, as opposed to individual aliased columns.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 17c9c9e8b..148da19aa 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1315,8 +1315,13 @@ class SQLCompiler(Compiled):
zip(newelem.right.element.c, selectable_.c)
)
+ # translating from both the old and the new
+ # because different select() structures will lead us
+ # to traverse differently
translate_dict[right.element.left] = selectable_
translate_dict[right.element.right] = selectable_
+ translate_dict[newelem.right.element.left] = selectable_
+ translate_dict[newelem.right.element.right] = selectable_
# propagate translations that we've gained
# from nested visit(newelem.right) outwards