diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-19 20:11:29 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-19 20:11:29 +0000 |
commit | bd3a65252d2f9155b7f2c1c6284074ba6e555d1f (patch) | |
tree | 00d2369aea4ae48c95b9d6314aa39258fd1fb7eb /lib/sqlalchemy/sql/compiler.py | |
parent | 840a2fabb8999b4b3807dfa55d771627656ab1db (diff) | |
download | sqlalchemy-bd3a65252d2f9155b7f2c1c6284074ba6e555d1f.tar.gz |
- Oracle assembles the correct columns in the result set
column mapping when generating a LIMIT/OFFSET subquery,
allows columns to map properly to result sets even
if long-name truncation kicks in [ticket:941]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 666a38d39..71bfd1765 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -468,13 +468,20 @@ class DefaultCompiler(engine.Compiled): else: return column - def visit_select(self, select, asfrom=False, parens=True, **kwargs): + def visit_select(self, select, asfrom=False, parens=True, iswrapper=False, **kwargs): stack_entry = {'select':select} - - if asfrom or (self.stack and 'select' in self.stack[-1]): + prev_entry = self.stack and self.stack[-1] or None + + if asfrom or (prev_entry and 'select' in prev_entry): stack_entry['is_subquery'] = True + if prev_entry and 'iswrapper' in prev_entry: + column_clause_args = {'result_map':self.result_map} + else: + column_clause_args = {} + elif iswrapper: column_clause_args = {} + stack_entry['iswrapper'] = True else: column_clause_args = {'result_map':self.result_map} |