Bugs item #1344338, was opened at 2005-10-31 17:28
Message generated for change (Comment added) made by adustman
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1344338&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: MySQL
Group: SQLObject release (specify)
Status: Open
Resolution: None
Priority: 5
Submitted By: Andy Dustman (adustman)
Assigned to: Nobody/Anonymous (nobody)
Summary: 0.7.0: autoCommit from URI wrong type
Initial Comment:
In dbconnection.py, when the URI is parsed, there is no
special treatment or type conversion of the autoCommit
parameter, so it is always stored as a string. In the
MySQL case (mysql.mysqlconnection), this causes the
call to conn.autocommit() to always, since that API
function requires an integer (booleans work too).
A workaround for this is to change
conn.autocommit(self.autoCommit) to
conn.autocommit(int(self.autoCommit)), though only
works if an integer is used as a parameter; it fails if
True or False is used.
Note that sybase support has this sequence in
SybaseConnection.__init__():
autoCommit = kw.get('autoCommit')
if autoCommit:
autoCommmit = int(autoCommit)
else:
autoCommit = None
kw['autoCommit'] = autoCommit
DBAPI.__init__(self, **kw)
A similar block of code would also work for MySQLdb.
----------------------------------------------------------------------
>Comment By: Andy Dustman (adustman)
Date: 2005-11-02 16:05
Message:
Logged In: YES
user_id=71372
That doesn't work; I tried it previously. It results in
SQLObject trying to do conn.autocommit(''), which still
results in a TypeError. Even though '' == False, it is not
an integer, and thismethod requires an integer (or boolean).
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-11-02 15:42
Message:
Logged In: YES
user_id=4799
Pass autoCommit as an empty string:
mysql://server:port/db?autoCommit=&debug=
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1344338&group_id=74338
|