Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 32334
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: fdintino [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 4.006
Fixed in: (no value)



Subject: mysql_server_init and mysql_server_end link errors with mysql 3.23.xx
In dbdimp.c, mysql_server_init and mysql_server_end are called when DBD_MYSQL_EMBEDDED is not defined. For the client/server version of mysql these are dummy functions, but they aren't defined in mysql.h for mysql <= 3.23.58, so it produces linker errors. When I run it currently (perl v5.6.1, linked against mysql-3.23-sun-solaris2.9-sparc), I get the following warnings on make: "dbdimp.c", line 464: warning: implicit function declaration: parse_number "dbdimp.c", line 1456: warning: implicit function declaration: mysql_server_init "dbdimp.c", line 1970: warning: implicit function declaration: mysql_server_end and this error in make test: /00base............ok 3/5install_driver(mysql) failed: Can't load 'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_server_init: referenced symbol not found at /usr/perl5/5.6.1/lib/sun4-solaris-64int/DynaLoader.pm line 206. Compilation failed in require at (eval 1) line 3. If I comment out the lines in dbdimp.c for mysql_server_init on non-embedded server: #else mysql_server_init(-1, NULL, NULL); I get the same thing, only with mysql_server_end. Removing the lines #else mysql_server_end(); leads to a successful test. Since these functions don't do anything in client/server mysql, and they break it for mysql-3.23.xx (including the most recent), they should probably be removed. I've attached a patch for dbdimp.c which does this.
Subject: dbdimp.c.patch
--- dbdimp.c 2007-12-11 16:41:50.000000000 -0500 +++ dbdimp.c.new 2008-01-15 12:13:49.612496000 -0500 @@ -1452,8 +1452,6 @@ } } } -#else - mysql_server_init(-1, NULL, NULL); #endif #ifdef MYSQL_NO_CLIENT_FOUND_ROWS @@ -1966,8 +1964,6 @@ } -#else - mysql_server_end(); #endif /* The disconnect_all concept is flawed and needs more work */
From: CAPTTOFU [...] cpan.org
Thank you very much for this patch! I'll be putting out a release soon to include this fix. Thanks again! On Tue Jan 15 13:41:07 2008, fdintino wrote: Show quoted text
> In dbdimp.c, mysql_server_init and mysql_server_end are called when > DBD_MYSQL_EMBEDDED is not defined. For the client/server version of > mysql these are > dummy functions, but they aren't defined in mysql.h for mysql <= > 3.23.58, so it produces > linker errors. > > When I run it currently (perl v5.6.1, linked against mysql-3.23-sun- > solaris2.9-sparc), I get > the following warnings on make: > "dbdimp.c", line 464: warning: implicit function declaration: > parse_number > "dbdimp.c", line 1456: warning: implicit function declaration: > mysql_server_init > "dbdimp.c", line 1970: warning: implicit function declaration: > mysql_server_end > > and this error in make test: > > /00base............ok 3/5install_driver(mysql) failed: Can't load > 'blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: > perl: fatal: relocation > error: file blib/arch/auto/DBD/mysql/mysql.so: symbol > mysql_server_init: referenced symbol > not found at /usr/perl5/5.6.1/lib/sun4-solaris-64int/DynaLoader.pm > line 206. > Compilation failed in require at (eval 1) line 3. > > If I comment out the lines in dbdimp.c for mysql_server_init on non- > embedded server: > > #else > mysql_server_init(-1, NULL, NULL); > > I get the same thing, only with mysql_server_end. Removing the lines > > #else > mysql_server_end(); > > leads to a successful test. Since these functions don't do anything in > client/server mysql, and > they break it for mysql-3.23.xx (including the most recent), they > should probably be > removed. I've attached a patch for dbdimp.c which does this.
Closing.