summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
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