diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-03 19:42:38 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-03 19:42:38 -0400 |
commit | 2b10aa45a101acfcc6090a3801af998ef8fc1a2d (patch) | |
tree | 60329bc3771b31910eb3d1e51412525ed4222066 /lib/sqlalchemy/sql/compiler.py | |
parent | 4399431b53e5d132672431205c654d7d6b32dd77 (diff) | |
download | sqlalchemy-2b10aa45a101acfcc6090a3801af998ef8fc1a2d.tar.gz |
- ensure literal_binds works with LIMIT clause, FOR UPDATE
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 23e5456a7..e92520620 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1593,10 +1593,10 @@ class SQLCompiler(Compiled): if (select._limit_clause is not None or select._offset_clause is not None): - text += self.limit_clause(select) + text += self.limit_clause(select, **kwargs) if select._for_update_arg is not None: - text += self.for_update_clause(select) + text += self.for_update_clause(select, **kwargs) if self.ctes and \ compound_index == 0 and toplevel: @@ -1653,7 +1653,7 @@ class SQLCompiler(Compiled): else: return "" - def for_update_clause(self, select): + def for_update_clause(self, select, **kw): return " FOR UPDATE" def returning_clause(self, stmt, returning_cols): @@ -1661,14 +1661,14 @@ class SQLCompiler(Compiled): "RETURNING is not supported by this " "dialect's statement compiler.") - def limit_clause(self, select): + def limit_clause(self, select, **kw): text = "" if select._limit_clause is not None: - text += "\n LIMIT " + self.process(select._limit_clause) + text += "\n LIMIT " + self.process(select._limit_clause, **kw) if select._offset_clause is not None: if select._limit_clause is None: text += "\n LIMIT -1" - text += " OFFSET " + self.process(select._offset_clause) + text += " OFFSET " + self.process(select._offset_clause, **kw) return text def visit_table(self, table, asfrom=False, iscrud=False, ashint=False, |