RE: test error on installation of DBD::mysql v2.1026 with mysql v4.1.11

"Tim Maynard" <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <31D549ADED852D428CDC2A05ED1F38B38BD80B@mailsrvr2.klem.redeyeusa.com>
- updated my Bundle::DBI through CPAN without any complaints.
- retrieved DBD-mysql-2.9007 version of the driver.
- noticed that i complied mysql with gcc, so modified the Makefile
    to also compile DBD::mysql with gcc as well, including the
libraries:

	-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lgcc

-----------------------------------------------------------
make

cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c -I/usr/lib/perl5/site_perl/5.8.6/i686-linux/auto/DBI/
-I/usr/include/mysql 
    -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g
-fno-strict-aliasing -pipe 
    -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm -O2   
    -DVERSION=\"2.9007\" -DXS_VERSION=\"2.9007\" -fpic
"-I/usr/lib/perl5/5.8.6/i686-linux/CORE"   
    dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" 
    /usr/lib/perl5/site_perl/5.8.6/i686-linux/auto/DBI//Driver.xst >
mysql.xsi
/usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.8.6/ExtUtils/typemap  
    mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line
196
Warning: duplicate function definition 'rows' detected in mysql.xs, line
294
gcc -c -I/usr/lib/perl5/site_perl/5.8.6/i686-linux/auto/DBI/
-I/usr/include/mysql 
    -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g
-fno-strict-aliasing -pipe 
    -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm -O2   
    -DVERSION=\"2.9007\" -DXS_VERSION=\"2.9007\" -fpic
"-I/usr/lib/perl5/5.8.6/i686-linux/CORE"   
    mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/lib/mysql:/usr/lib" /usr/bin/perl myld gcc -shared
-L/usr/local/lib 
    -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lgcc dbdimp.o mysql.o  
    -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/lib/mysql -lmysqlclient
-L/usr/lib -lz -lcrypt 
    -lnsl -lm -L/usr/local/ssl/lib -lssl -lcrypto
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Mysql.3
Manifying blib/man3/Bundle::DBD::mysql.3

-----------------------------------------------------------
make test

PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
    "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base...........install_driver(mysql) failed: Can't load 
 
'/root/.cpan/build/DBD-mysql-2.9007/blib/arch/auto/DBD/mysql/mysql.so' 
    for module DBD::mysql:
/root/.cpan/build/DBD-mysql-2.9007/blib/arch/auto/DBD/mysql/mysql.so: 
    undefined symbol: mysql_drop_db at
/usr/lib/perl5/5.8.6/i686-linux/DynaLoader.pm line 230.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at t/00base.t line 38
t/00base...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
        Failed 2/5 tests, 60.00% okay
        
<... edit ...>

t/akmisc...........Had to create DBD::mysql::dr::imp_data_size
unexpectedly at /usr/lib/perl5/site_perl/5.8.6/i686-linux/DBI.pm line
1167.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/site_perl/5.8.6/i686-linux/DBI.pm line 1167.
Can't locate object method "connect" via package "Mysql" at
/root/.cpan/build/DBD-mysql-2.9007/blib/lib/Mysql.pm line 71.
t/akmisc...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-352

-----------------------------------------------------------
installed it anyways and got the following output
using the modified test script from earlier

-----------------------------------------------------------
test_dbd.pl

#!/usr/bin/perl -w

use strict;
use DBI;

# global values
my $host = 'localhost';
my $db   = 'host_db';
my $tbl  = 'host_tbl';
my $idx  = 'table_key';
my $user = 'username';
my $pswd = 'password';

my( $dbh, $sql, $sth, $cur );

print qq~connecting to db...\n~;
# converted to an eval statement
#$dbh = DBI->connect(qq~dbi:mysql:host_db:localhost~,$user,$pswd) or
#	die(qq~cant open db: $DBI::errstr\n~);
eval '$dbh =
DBI->connect(qq~dbi:mysql:host_db:localhost~,$user,$pswd);';
if( $@ ){
	print "'".$@."'";
	print DBI->trace();
	exit();
}

$sql = qq~select distinct $idx from $tbl order by $idx desc limit 25~;

print qq~preparing sql statement...\n~;
$sth = $dbh->prepare( $sql);

print qq~executing statement...\n~;
$sth->execute();

print qq~fetching data by row arrays...\n~;
while( $cur = ($sth->fetchrow_array())[0] ){
	print qq~found: '$cur'\n~;
}

print qq~done.\n~;

-----------------------------------------------------------
output

connecting to db...
preparing sql statement...
executing statement...
fetching data by row arrays...
found: 'id_last'
... edit x 23 ...
found: 'id_last-24'
done.
Segmentation fault
-----------------------------------------------------------

it appears to be doing its job, but seg-faulted at closure


-----Original Message-----
From: Rudy Lippan [mailto:[email protected]] 
Sent: Thursday, May 05, 2005 9:39 AM
To: Tim Maynard
Cc: [email protected]
Subject: RE: test error on installation of DBD::mysql v2.1026 with mysql
v4.1.11


On Thu, 5 May 2005, Tim Maynard wrote:

> im using v2.9006 [DBD-mysql-2.9006] and i just found v2.9007 on cpan, 
> but the changelog for this didnt seem significant for my issues.


If you are still getting the segfaults with the latest version, send a
DBI->trace(9) and a stack trace. You might also want to verify that you 
DBI->are
linking against the correct client libraries when building DBD::mysql.


rudy



-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.