]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
If there's a zero offset with mssql just ignore it.
authorMichael Trier <mtrier@gmail.com>
Mon, 10 Nov 2008 01:11:40 +0000 (01:11 +0000)
committerMichael Trier <mtrier@gmail.com>
Mon, 10 Nov 2008 01:11:40 +0000 (01:11 +0000)
lib/sqlalchemy/databases/mssql.py

index 0909587954b88c3646c42ffd999059a8001d0e4b..923e85ceabc2c5d3e2ad5d9a6beb3c62c69755a6 100644 (file)
@@ -950,7 +950,7 @@ class MSSQLCompiler(compiler.DefaultCompiler):
         so tries to wrap it in a subquery with ``row_number()`` criterion.
 
         """
-        if self.dialect.has_window_funcs and (not getattr(select, '_mssql_visit', None)) and (select._offset is not None):
+        if self.dialect.has_window_funcs and (not getattr(select, '_mssql_visit', None)) and select._offset:
             # to use ROW_NUMBER(), an ORDER BY is required.
             orderby = self.process(select._order_by_clause)
             if not orderby: