summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorDobes Vandermeer <dvandermeer@roovy.com>2014-04-25 10:42:12 -0700
committerDobes Vandermeer <dvandermeer@roovy.com>2014-04-25 10:42:12 -0700
commit4af172b644d90f1bcab3de2bd0501a9cf50dc1d5 (patch)
tree7aba558ad48bee120a64a8350e6a515cdca7b3d2 /lib/sqlalchemy/sql/compiler.py
parente9b398f8a6ecd5b68142ab334a81683eff966e09 (diff)
downloadsqlalchemy-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/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index b59e8a941..557ab1531 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -774,7 +774,7 @@ class SQLCompiler(Compiled):
text += " GROUP BY " + group_by
text += self.order_by_clause(cs, **kwargs)
- text += (cs._limit is not None or cs._offset is not None) and \
+ text += (cs._limit_clause is not None or cs._offset_clause is not None) and \
self.limit_clause(cs) or ""
if self.ctes and \
@@ -1557,7 +1557,7 @@ class SQLCompiler(Compiled):
text += self.order_by_clause(select,
order_by_select=order_by_select, **kwargs)
- if select._limit is not None or select._offset is not None:
+ if select._limit_clause is not None or select._offset_clause is not None:
text += self.limit_clause(select)
if select._for_update_arg is not None:
@@ -1625,12 +1625,12 @@ class SQLCompiler(Compiled):
def limit_clause(self, select):
text = ""
- if select._limit is not None:
- text += "\n LIMIT " + self.process(_literal_as_binds(select._limit))
- if select._offset is not None:
- if select._limit is None:
+ if select._limit_clause is not None:
+ text += "\n LIMIT " + self.process(select._limit_clause)
+ if select._offset_clause is not None:
+ if select._limit_clause is None:
text += "\n LIMIT -1"
- text += " OFFSET " + self.process(_literal_as_binds(select._offset))
+ text += " OFFSET " + self.process(select._offset_clause)
return text
def visit_table(self, table, asfrom=False, iscrud=False, ashint=False,