Bug #30785 DBD::mysql 4.005 - MySQL 5.0.45 (ppc64) compability issue
Submitted: 4 Sep 2007 9:37 Modified: 29 Oct 2007 18:23
Reporter: Ray Sweeten Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:10.4.10 OS:MacOS (darwin 8.10.0, Perl 5.8.6)
Assigned to: Kent Boortz CPU Architecture:Any

[4 Sep 2007 9:37] Ray Sweeten
Description:
I first installed mysql 5.0.45ppc64, and everything was fine until I tried installing the DBD::mysql 4.005 module. I've seen notes here and there suggesting a possible 32-64 compatibility issue. I am confirming a compatibility issue with DBD::mysql 4.005 and Mysql 5.0.45(64bit version). these errors appear:

Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612

mysql.xs: In function 'XS_DBD__mysql__db_do':
mysql.xs:315: warning: comparison is always false due to limited range of data type
mysql.xs:316: warning: comparison is always false due to limited range of data type

LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld env MACOSX_DEPLOYMENT_TARGET=10.3 cc  -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.bundle   -L/usr/local/mysql/lib -lmysqlclient -lz -lm   
/usr/bin/ld: dbdimp.o bad magic number (not a Mach-O file)
/usr/bin/ld: mysql.o bad magic number (not a Mach-O file)
/usr/bin/ld: /usr/local/mysql/lib/libmysqlclient.dylib bad magic number (not a Mach-O file)

this is resolved by installing the 32-bit version.

How to repeat:
Install mysql-5.0.45-osx10.4-powerpc-64bit, start mysql server

Download and unzip DBD-mysql-4.005.tar and cd to DBD-mysql-4.005

perl makefile.pl (with appropriate --cflags and --libs)
make

Suggested fix:
I simply installed the 32-bit version, and with the workaround for the mysql_config issue it works fine. Barring that, recoding mach-o versions dbdimp.o, mysql.o, and libmysqlclient.dylib..
[5 Sep 2007 7:12] Ray Sweeten
incidentally, make still returns the multiple do and rows error..
[5 Sep 2007 7:40] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 Oct 2007 17:30] Kent Boortz
The mysql_config problem should be resolved part of bug#28544.
Looking into the other issues.
[29 Oct 2007 18:23] Kent Boortz
The warnings about functions 'do' and 'row' is from
the Perl "xsubpp" tool. And there are in fact definitions
of these functions both in "mysql.xs" and "mysql.xsi",
i.e. this is not a bug in the MySQL server package.

It is also natural that you have to match the word size
of the 3rd party package you link with the MySQL client
library, unless an universal binary is used, something
that is provided as a separate "universal" MySQL server
package.