Oh, just read a little better... wanted to clarify...

"""  It doesnt work with stored procedures though.  I put a patch up on sourceforge in July, for the ZMySQLDA. """

Mysql-python works fine fine, as you said Andy, it's just the Zope DA.

Greg

(I hate it when reply-all doesnt send to zope list too)

On 10/7/05, Greg Fischer <[EMAIL PROTECTED]> wrote:
It doesnt work with stored procedures though.  I put a patch up on sourceforge in July, for the ZMySQLDA.

http://sourceforge.net/tracker/index.php?func=detail&aid=1242842&group_id=22307&atid=374934

I probably didnt do it right, but I at least wanted to get the info up there. (maybe should have listed a bug?)  MySQLdb works fine directly from python, but the DA doesnt open a connection with the right client_flags.  It needs MULTI_STATEMENTS.

I just added this to db.py in _parse_connection_string, right before it parses the socket. (line 234, I think)

if not items: return kwargs
kwargs['client_flag'], items = int(items[0]), items[1:]

One caveat, you must use a dash to turn off transactions.  I don't know why that is, or how to get around it.  But, with that patch, and a connection string like the one below, it works great!

    -adatabase auser apassword 65536 /tmp/mysql.sock

I just wanted to specify the client_flags before the socket.  Before you couldnt specify them at all.  On Linux this was fine, but on Windows, if memory serves, the mysql.c had some issues. Maybe needs compiled with new libs?

Anyway, like I said on that patch post, there is probably a better way to tackle the issue.  I just did it this way, and it works for me. Though, the transaction thing needs attention.

Greg




On 10/7/05, Andy Dustman <[EMAIL PROTECTED] > wrote:
On 10/7/05, Tres Seaver <[EMAIL PROTECTED]> wrote:
> Greg Fischer wrote:
>
> > I guess it's not a matter of should, but rather a preference. I am running
> > it just fine on Linux. Had to do some tweeks to the ZMySQLDA, but it works
> > great. Stored Procedures and everything. I just havent seen hardly anyone
> > testing it, so I thought I would ask around and see if others are running it
> > too.
>
> Cool.  Could you send the patches for your tweaks to the ZMySQLDA
> maintainer (Andy Dustman, I believe)?  Maybe it would be better to
> upload them to the SourceForge patches page:

I've done a small amount of testing with MySQLdb-1.2.0 and MySQL-5.0,
and there don't seem to be any issues, so ZMySQLDA-2.0.9 (latest beta)
ought to work as well. There is a bugfix that needs to be applied (for
the "tried to unlock unlocked lock" issue), but this should already be
in the bug tracker on sourceforge.

--
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html



--
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com



--
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to