From 2b10aa45a101acfcc6090a3801af998ef8fc1a2d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 3 Sep 2014 19:42:38 -0400 Subject: - ensure literal_binds works with LIMIT clause, FOR UPDATE --- lib/sqlalchemy/dialects/postgresql/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index f1418f903..575d2a6dd 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1309,14 +1309,14 @@ class PGCompiler(compiler.SQLCompiler): def visit_sequence(self, seq): return "nextval('%s')" % self.preparer.format_sequence(seq) - 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 ALL" - text += " OFFSET " + self.process(select._offset_clause) + text += " OFFSET " + self.process(select._offset_clause, **kw) return text def format_from_hint_text(self, sqltext, table, hint, iscrud): @@ -1337,7 +1337,7 @@ class PGCompiler(compiler.SQLCompiler): else: return "" - def for_update_clause(self, select): + def for_update_clause(self, select, **kw): if select._for_update_arg.read: tmp = " FOR SHARE" @@ -1349,7 +1349,7 @@ class PGCompiler(compiler.SQLCompiler): c.table if isinstance(c, expression.ColumnClause) else c for c in select._for_update_arg.of) tmp += " OF " + ", ".join( - self.process(table, ashint=True) + self.process(table, ashint=True, **kw) for table in tables ) -- cgit v1.2.1