diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-27 17:05:01 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-27 17:05:01 -0400 |
commit | d64b09b15c703d7e100931818976822256f6beda (patch) | |
tree | fb46d2b6aa486f47f7e949ba14f145c00aa0f7c5 /lib/sqlalchemy | |
parent | a6adc0a53ebfeeea23ec63655629c5b6831a77d0 (diff) | |
download | sqlalchemy-d64b09b15c703d7e100931818976822256f6beda.tar.gz |
- fix issue in join rewriting whereby we need to ensure the .key and .name
are transferred correctly for when .key is present; tests have been enhanced
to test this condition for render, result map construction, statement
execution. [ticket:2790]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index a5f545de9..72bebca3d 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1162,7 +1162,8 @@ class SQLCompiler(engine.Compiled): use_labels=True).alias() for c in selectable.c: - c._label = c._key_label = c.name + c._key_label = c.key + c._label = c.name translate_dict = dict( zip(right.element.c, selectable.c) ) @@ -1199,6 +1200,7 @@ class SQLCompiler(engine.Compiled): def _transform_result_map_for_nested_joins(self, select, transformed_select): inner_col = dict((c._key_label, c) for c in transformed_select.inner_columns) + d = dict( (inner_col[c._key_label], c) for c in select.inner_columns |