diff options
| author | Dobes Vandermeer <dvandermeer@roovy.com> | 2014-04-25 10:42:12 -0700 |
|---|---|---|
| committer | Dobes Vandermeer <dvandermeer@roovy.com> | 2014-04-25 10:42:12 -0700 |
| commit | 4af172b644d90f1bcab3de2bd0501a9cf50dc1d5 (patch) | |
| tree | 7aba558ad48bee120a64a8350e6a515cdca7b3d2 /lib/sqlalchemy/dialects/mssql/base.py | |
| parent | e9b398f8a6ecd5b68142ab334a81683eff966e09 (diff) | |
| download | sqlalchemy-4af172b644d90f1bcab3de2bd0501a9cf50dc1d5.tar.gz | |
Use _offset_clause and _limit_clause, which are always Visitable and usually a BindParameter, instead of _offset and _limit in GenerativeSelect.
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/mssql/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 9a8cddd98..6a13d1dca 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -741,15 +741,16 @@ class MSSQLCompiler(compiler.SQLCompiler): def get_select_precolumns(self, select): """ MS-SQL puts TOP, it's version of LIMIT here """ - if select._distinct or select._limit is not None: + limit = select._limit + if select._distinct or limit is not None: s = select._distinct and "DISTINCT " or "" # ODBC drivers and possibly others # don't support bind params in the SELECT clause on SQL Server. # so have to use literal here. - if select._limit is not None: + if limit is not None: if not select._offset: - s += "TOP %d " % select._limit + s += "TOP %d " % limit return s return compiler.SQLCompiler.get_select_precolumns(self, select) |
