Skip Menu |
 

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

Report information
The Basics
Id: 6034
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: david_dick [...] iprimus.com.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.31
Fixed in: (no value)

Attachments
SQLite_fetch_on_empty_sth.patch



Subject: Patch for segfault issue
Download (untitled) / with headers
text/plain 437b
segfault found when after having retrieved all the rows from a sth, another attempt causes perl to segfault. Fixed by uncommenting existing code as shown in patch. Patch also includes testcase to replicate this problem. perl -v This is perl, v5.8.0 built for i386-linux-thread-multi (with 1 registered patch, see perl -V for more detail) uname -a Linux localhost 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
diff -ru DBD-SQLite-0.31/dbdimp.c new/dbdimp.c --- DBD-SQLite-0.31/dbdimp.c 2004-02-15 04:36:38.000000000 +1100 +++ new/dbdimp.c 2004-04-16 10:09:59.000000000 +1000 @@ -455,11 +455,9 @@ /* warn("current_entry == %d\nnumFields == %d\nnrow == %d", current_entry, numFields, imp_sth->nrow); */ - /* if (!DBIc_ACTIVE(imp_sth)) { return Nullav; } - */ if ((imp_sth->retval == SQLITE_DONE) || (imp_sth->retval == SQLITE_ERROR)) { sqlite_st_finish(sth, imp_sth); diff -ru DBD-SQLite-0.31/t/30insertfetch.t new/t/30insertfetch.t --- DBD-SQLite-0.31/t/30insertfetch.t 2002-02-20 04:19:57.000000000 +1100 +++ new/t/30insertfetch.t 2004-04-16 10:20:53.000000000 +1000 @@ -125,6 +125,11 @@ $cursor->errstr eq '')), 'fetch select deleted') or DbiError($cursor->err, $cursor->errstr); + Test($state or (!defined($row = $cursor->fetchrow_arrayref) && + (!defined($errstr = $cursor->errstr) || + $cursor->errstr eq '')), 'fetch on empty statement handler') + or DbiError($cursor->err, $cursor->errstr); + Test($state or $cursor->finish, 'finish select deleted') or DbiError($cursor->err, $cursor->errstr);


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.