diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-21 22:46:31 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-21 22:49:29 -0500 |
commit | eff7b4f29d2a98ef4ccd95b693c7d653eaa543eb (patch) | |
tree | 98dc9a49993792580df9d38f747f591054db68f6 /lib/sqlalchemy/sql/compiler.py | |
parent | 01809bddff5b6e93010eb139aed54526c6e6c058 (diff) | |
download | sqlalchemy-eff7b4f29d2a98ef4ccd95b693c7d653eaa543eb.tar.gz |
- additional adjustment to the fix made in 8ad968f33100baeb3b13c7e0b724b6b79ab4277f
for ref #3657. The Oracle dialect makes more use of the "select_wraps_for"
feature than SQL server because Oracle doesn't have "TOP" for a limit-only
select, so tests are showing more happening here. In the case where
the select() has some dupe columns, these are deduped from the .c collection
so a positional match between the wrapper and original can't use .inner_columns,
because these collections wont match. Using _columns_plus_names
instead which is the deduped collection that determines the SELECT display,
which definitely have to match up.
(cherry picked from commit aa9ce3f521f254da9879ede011e520ec35b8270e)
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index b75dc1c07..8600dbaeb 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1640,7 +1640,10 @@ class SQLCompiler(Compiled): # rewrite the targeted columns in the result map translate = dict( - zip(select.inner_columns, select_wraps_for.inner_columns) + zip( + [name for (key, name) in select._columns_plus_names], + [name for (key, name) in + select_wraps_for._columns_plus_names]) ) self._result_columns = [ |