Subject: | Segfault for multiple result set |
The attached program returning results from the sample database
segfaults. I'm currently using DBI-1.48, DBD::DB2-0.80 and
perl-5.8.7. I'm running on Linux.
gdb perl
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...(no debugging symbols
found)
Using host libthread_db library "/lib/libthread_db.so.1".
Show quoted text
gdb> run db2-segfault.pl
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1210214208 (LWP 4129)]
FETCH...
Sanders
Pernal
James
Sneider
FETCH...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210214208 (LWP 4129)]
Error while running hook_stop:
Invalid type combination in ordering comparison.
0xb7d9e1d7 in dbih_get_fbav ()
from /opt/perl/apee548/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/DBI/DBI.so
Show quoted textgdb> bt
#0 0xb7d9e1d7 in dbih_get_fbav ()
from /opt/perl/apee548/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/DBI/DBI.so
#1 0xb7d901a3 in db2_st_fetch ()
from /opt/perl/apee548/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/DBD/DB2/DB2.so
#2 0xb7d86acd in XS_DBD__DB2__st_fetchrow_array ()
from /opt/perl/apee548/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/DBD/DB2/DB2.so
#3 0xb7da4cdf in XS_DBI_dispatch ()
from /opt/perl/apee548/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/DBI/DBI.so
#4 0x080b5603 in Perl_pp_entersub ()
#5 0x080aee01 in Perl_runops_standard ()
#6 0x0806376d in S_run_body ()
#7 0x08063466 in perl_run ()
#8 0x0805ff79 in main ()
Subject: | db2-segfault.pl |
use strict;
use DBI;
my $dbh = DBI->connect("dbi:DB2:sample","","") || die "$DBI::dberr";
$dbh->do("drop procedure foo");
$dbh->do(<<EOT);
create procedure foo
language sql
BEGIN
declare tab1 cursor with return to client for
SELECT * FROM staff;
declare tab2 cursor with return to client for
SELECT name FROM staff WHERE dept = 20;
open tab2;
open tab1;
END
EOT
my $sth = $dbh->prepare("call foo");
$sth->execute || die;
do {
print "FETCH...\n";
while (my @row = $sth->fetchrow) {
printf "@row\n";
}
} while ($sth->{db2_more_results});