I get an exception, when I try to use a bindparam variable twice in a query
in MySql like this:
TestTable.name == bindparam('username', type_ = String),
TestTable.username == bindparam('username', type_ = String)
- ubuntu 13.10 64bit
- python 3.3.2
- sqlalchemy 0.9.3
- mysql 5.5.35
-
I'll look into what happens there but you probably need to use the same
bindparam() object for now:
b = bindparam('username', type_=String)
tt.name == b
tt.username == b
On Mar 7, 2014, at 5:47 AM, Jas Per muz...@gmail.com wrote:
I get an exception, when I try to use a bindparam variable
unfortunately that doesn't help - its MySql server rejecting the statement
(SQlite and Postgres accept their delivered statements)
thanks for helping!
On Friday, March 7, 2014 3:44:00 PM UTC+1, Michael Bayer wrote:
I’ll look into what happens there but you probably need to use the same
doesn't fail for me. MySQL/connector/python is up to 1.1.6 so try that.
otherwise, need full log output + stack trace + exception message.
2014-03-07 11:52:06,805 INFO sqlalchemy.engine.base.Engine INSERT INTO
`TestTable` (name, username) VALUES (%(name_0)s, %(username_0)s)
2014-03-07
upgrading connector to 1.1.6 didn't change anything. tried python 2.7 after
that et voila: works! after some debugging found this in
mysql/connector/cursor.py line 498ff:
if isinstance(params, dict):
for key, value in self._process_params_dict(params).items():