[Zope] MySQLDA / MySQLdb problems

Eric L. Walstad ewalstad@energywright.com
Sun, 12 Mar 2000 09:48:26 -0800


Jo,
Thanks for your C expertise.  The changes you mentioned were all that was
needed to get the MySQLmodule to compile and the MySQLDA to work.  I now see
the ZMySQL Database Connection in my list of available items in Zope!!! (big
smile).

I will eventually want to get Andy Dustman's MySQLdb connection to work,
because it is multi-threaded.  But for now I will stick with what works,
learn how to tie Zope to MySQL and THEN go for the upgrade to MySQLdb.

Anyway, thanks again for taking the time to solve my problem.

Eric.

// -----Original Message-----
// From: Jo Meder [mailto:jo@delorges.in-berlin.de]
// Sent: Friday, March 10, 2000 2:13 PM
// To: Eric L. Walstad
// Cc: zope@zope.org
// Subject: Re: [Zope] MySQLDA / MySQLdb problems
//
//
// > I have tried everything that I can think of (& a lot of what
// some of you
// > could think of) to get MySQLdb to compile and install.  I have
// had no luck.
// [...]
// > <OUTPUT OF make>
// > # make
// > gcc -fpic -g -O2 -I/usr/include/python1.5
// -I/usr/include/python1.5 -DHAVE_CO
// > NFIG_H  -I/usr/local/mysql/include -I/usr/include/mysql -c
// ./MySQLmodule.c
// > ./MySQLmodule.c: In function `pythonify_row':
// > ./MySQLmodule.c:238: warning: assignment from incompatible pointer type
// > ./MySQLmodule.c: In function `pythonify_res_fields':
// > ./MySQLmodule.c:384: invalid lvalue in unary `&'
// > ./MySQLmodule.c: In function `STH_fetchdict':
// > ./MySQLmodule.c:1125: invalid lvalue in unary `&'
// > ./MySQLmodule.c:1147: invalid lvalue in unary `&'
// > make: *** [MySQLmodule.o] Error 1
// > </OUTPUT OF make>
//
// I suppose line 1125 of mySQLmodule.c is something like:
//
// 	tf = & (mysql_fetch_field_direct(self->res,j));
//
// If this is the case, try applying the following patch to your
// MySQLmodule.c (this is strictly "works for me"):
//
// ------------------cut here-----------------------------------------
// 235c235
// <     unsigned int *lengths;
// ---
// >     unsigned long *lengths;
// 384c384
// <         tf = &(mysql_fetch_field_direct(res, i));
// ---
// >         tf = (mysql_fetch_field_direct(res, i));
// 1125c1125
// <           tf = &(mysql_fetch_field_direct(self->res,j));
// ---
// >           tf = (mysql_fetch_field_direct(self->res,j));
// 1147c1147
// <               tf = &(mysql_fetch_field_direct(self->res,j));
// ---
// >               tf = (mysql_fetch_field_direct(self->res,j));
// -----------------cut here-------------------------------------------
//
//
// HTH.
//
// 	Jo.
//