diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-30 19:06:26 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-30 19:07:45 -0400 |
commit | 2a458680a49376b8a11b342bc679a870cdc05da6 (patch) | |
tree | 53f80d9269d0d602a01b11b57e5db518f3d0e2b3 /lib/sqlalchemy/sql/compiler.py | |
parent | 1caa7fafbd3c9870e1bf2b2ac623872447fc804e (diff) | |
download | sqlalchemy-2a458680a49376b8a11b342bc679a870cdc05da6.tar.gz |
- Fixed bug where the combination of "limit" rendering as
"SELECT FIRST n ROWS" using a bound parameter (only firebird has both),
combined with column-level subqueries
which also feature "limit" as well as "positional" bound parameters
(e.g. qmark style) would erroneously assign the subquery-level positions
before that of the enclosing SELECT, thus returning parameters which
are out of order. Fixes #3038
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 169dc2cc3..a7465204a 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1481,19 +1481,6 @@ class SQLCompiler(Compiled): 'within_columns_clause': False }) - # the actual list of columns to print in the SELECT column list. - inner_columns = [ - c for c in [ - self._label_select_column(select, - column, - populate_result_map, asfrom, - column_clause_args, - name=name) - for name, column in select._columns_plus_names - ] - if c is not None - ] - text = "SELECT " # we're off to a good start ! if select._hints: @@ -1514,6 +1501,20 @@ class SQLCompiler(Compiled): text += self._generate_prefixes(select, select._prefixes, **kwargs) text += self.get_select_precolumns(select) + + # the actual list of columns to print in the SELECT column list. + inner_columns = [ + c for c in [ + self._label_select_column(select, + column, + populate_result_map, asfrom, + column_clause_args, + name=name) + for name, column in select._columns_plus_names + ] + if c is not None + ] + text += ', '.join(inner_columns) if froms: |