From b1e1bf8e674f8175f33a03d0dd4d605256f1e9d7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 2 Jul 2013 18:24:58 -0400 Subject: Fixed bug when using multi-table UPDATE where a supplemental table is a SELECT with its own bound parameters, where the positioning of the bound parameters would be reversed versus the statement itself when using MySQL's special syntax. [ticket:2768] --- lib/sqlalchemy/sql/compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 0afcdfaec..7770c7fc7 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1606,8 +1606,6 @@ class SQLCompiler(engine.Compiled): extra_froms = update_stmt._extra_froms - colparams = self._get_colparams(update_stmt, extra_froms) - text = "UPDATE " if update_stmt._prefixes: @@ -1617,6 +1615,8 @@ class SQLCompiler(engine.Compiled): table_text = self.update_tables_clause(update_stmt, update_stmt.table, extra_froms, **kw) + colparams = self._get_colparams(update_stmt, extra_froms) + if update_stmt._hints: dialect_hints = dict([ (table, hint_text) -- cgit v1.2.1