[sqlalchemy] Bug bindparam/MySql

2014-03-07 Thread Jas Per
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 -

Re: [sqlalchemy] Bug bindparam/MySql

2014-03-07 Thread Michael Bayer
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

Re: [sqlalchemy] Bug bindparam/MySql

2014-03-07 Thread Jas Per
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

Re: [sqlalchemy] Bug bindparam/MySql

2014-03-07 Thread Michael Bayer
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

Re: [sqlalchemy] tying multiple sessions together with one transaction

2014-03-07 Thread Laurence Rowe
IIRC, the implementation of the two phase commit basically has everyone flush on Phase1, then report back as a vote. If there are any negative votes, the transaction manager instructs everyone to fail and rollback as Phase2. If you had a flush that caused an integrity error before

Re: [sqlalchemy] Bug bindparam/MySql

2014-03-07 Thread Jas Per
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():