[Zope-DB] Issues of MySQLdb and ZMySQLDA

Martin Gebert Murphy.Gebert@gmx.de
Sat, 14 Dec 2002 21:31:40 +0100


Hi list members!

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...

--------------------------

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.

--------------------------

Are these bugs, are these known, or did I simply miss something?

Have a quiet weekend!

Martin