[Zope] Help on MySQLDA

Eric L. Walstad ewalstad@energywright.com
Sat, 18 Mar 2000 22:41:43 -0800


Fabrice,

I ran into similar errors.  Here's the response from Jo Meder that helped me
get MySQLDA compiled:


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