[Zope-DB] Issues of MySQLdb and ZMySQLDA

Dieter Maurer dieter@handshake.de
Wed, 18 Dec 2002 23:22:27 +0100


Martin Gebert writes:
 > Some time ago I came across two issues with MySQLdb and ZMySQLDA, which 
 > I reported to Andy Dustman, owner of this two Products. I didn't get any 
 > answer until today, so I'd like to publish these on this list in the 
 > hope that someone more into this code could have an eye on it.
 > 
 > --------------------------
 > 
 > First, I ran into problems when I tried to do
 > 
 > from MySQLdb import *
 > 
 > in Python 2.1.3 (console) due to missing attributes in that package 
 > (some date and time attributes or functions). Deleting the referring 
 > declarations from the __init__.py/__all__ list seemed to work...
Looks fine.

Send him the patch.

Maybe place it in your member area on "Zope.org", too, such that others
can use it.

 > --------------------------
 > 
 > With the Zope MySQL DA, when I do shared or exclusive locking for InnoDB 
 > in a Z SQL Method like
 > 
 > select *
 > from Person
 > where Username = 'murphy'
 > lock in share mode
 > 
 > or
 > 
 > ...
 > for update
 > 
 > I get a
 > 
 > Error, _mysql_exceptions.OperationalError: (1064, "You have an error in 
 > your SQL syntax near 'LIMIT 10' at line 4")
 > 
 > whenever there's a MaxRows attribute set. If I set the MaxRows to 0 it 
 > works flawlessly.
 > My best guess would be that there's a problem with the order of the 
 > locking statements and the LIMIT parameter; the latter is simply 
 > appended to the SQL statement where it should appear before the locks.
I am sure you are right.

Proceed the same way as for the other bug.


Dieter