Re: [Sqlalchemy-tickets] [sqlalchemy] #2768: bound parameters in UPDATE..FROM are subject to mis-or
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-06-28 14:22:09
|
#2768: bound parameters in UPDATE..FROM are subject to mis-ordering
---------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: sql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
---------------------------+----------------------------------
Changes (by zzzeek):
* severity: major - 1-3 hours => minor - half an hour
Comment:
OK very easy:
{{{
#!diff
diff --git a/lib/sqlalchemy/sql/compiler.py
b/lib/sqlalchemy/sql/compiler.py
index 0afcdfa..7770c7f 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)
}}}
more of a test:
{{{
d1 = DefaultDialect()
d1.positional = True
c1 = stmt.compile(dialect=d1)
print c1
print c1.positiontup
compiled = stmt.compile(dialect=mysql.dialect())
print compiled
print compiled.positiontup
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2768#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|