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/dialects/mysql/base.py | |
| parent | 4399431b53e5d132672431205c654d7d6b32dd77 (diff) | |
| download | sqlalchemy-2b10aa45a101acfcc6090a3801af998ef8fc1a2d.tar.gz | |
- ensure literal_binds works with LIMIT clause, FOR UPDATE
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 012d178e7..4dccd2760 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1662,13 +1662,13 @@ class MySQLCompiler(compiler.SQLCompiler): " ON ", self.process(join.onclause, **kwargs))) - def for_update_clause(self, select): + def for_update_clause(self, select, **kw): if select._for_update_arg.read: return " LOCK IN SHARE MODE" else: return " FOR UPDATE" - def limit_clause(self, select): + def limit_clause(self, select, **kw): # MySQL supports: # LIMIT <limit> # LIMIT <offset>, <limit> @@ -1694,15 +1694,15 @@ class MySQLCompiler(compiler.SQLCompiler): # bound as part of MySQL's "syntax" for OFFSET with # no LIMIT return ' \n LIMIT %s, %s' % ( - self.process(offset_clause), + self.process(offset_clause, **kw), "18446744073709551615") else: return ' \n LIMIT %s, %s' % ( - self.process(offset_clause), - self.process(limit_clause)) + self.process(offset_clause, **kw), + self.process(limit_clause, **kw)) else: # No offset provided, so just use the limit - return ' \n LIMIT %s' % (self.process(limit_clause),) + return ' \n LIMIT %s' % (self.process(limit_clause, **kw),) def update_limit_clause(self, update_stmt): limit = update_stmt.kwargs.get('%s_limit' % self.dialect.name, None) |
