Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: VLYON [...] cpan.org
Cc:
AdminCc:

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



Subject: ping() wipes out the errstr
According to DBI the ping() method won't affect the errstr from a previous error. http://search.cpan.org/perldoc?DBI#err However in DBD::SQLite it wipes it out and sets the errstr to undef! Diff to test for it: Index: DBD-SQLite/t/07_error.t =================================================================== --- DBD-SQLite/t/07_error.t (revision 13493) +++ DBD-SQLite/t/07_error.t (working copy) @@ -7,7 +7,7 @@ } use t::lib::Test; -use Test::More tests => 8; +use Test::More tests => 9; use Test::NoWarnings; my $dbh = connect_ok( RaiseError => 1, PrintError => 0 ); @@ -18,6 +18,9 @@ is( $DBI::err, 1, '$DBI::err ok' ); is( $DBI::errstr, 'near "ssdfsdf": syntax error', '$DBI::errstr ok' ); +$dbh->ping; # ping() should not clear the errstr! +is $dbh->errstr, 'near "ssdfsdf": syntax error', '$dbh->ping does not clear the error'; + $dbh->do('create table testerror (a, b)'); $dbh->do('insert into testerror values (1, 2)'); $dbh->do('insert into testerror values (3, 4)');
Well, actually DBD::SQLite does nothing about "ping". The method is from DBI, and it somehow does not do the right thing (the same thing happens when you use DBD::Sponge). Could you report this to the DBI's tracker? Thanks, Kenichi On Thu Dec 23 10:59:05 2010, VLYON wrote: Show quoted text
> According to DBI the ping() method won't affect the errstr from a > previous error. > http://search.cpan.org/perldoc?DBI#err > > However in DBD::SQLite it wipes it out and sets the errstr to undef! > > Diff to test for it: > > Index: DBD-SQLite/t/07_error.t > =================================================================== > --- DBD-SQLite/t/07_error.t (revision 13493) > +++ DBD-SQLite/t/07_error.t (working copy) > @@ -7,7 +7,7 @@ > } > > use t::lib::Test; > -use Test::More tests => 8; > +use Test::More tests => 9; > use Test::NoWarnings; > > my $dbh = connect_ok( RaiseError => 1, PrintError => 0 ); > @@ -18,6 +18,9 @@ > is( $DBI::err, 1, '$DBI::err ok' ); > is( $DBI::errstr, 'near "ssdfsdf": syntax error', '$DBI::errstr
ok' ); Show quoted text
> > +$dbh->ping; # ping() should not clear the errstr! > +is $dbh->errstr, 'near "ssdfsdf": syntax error', '$dbh->ping does not > clear the error'; > + > $dbh->do('create table testerror (a, b)'); > $dbh->do('insert into testerror values (1, 2)'); > $dbh->do('insert into testerror values (3, 4)');
Implemented ping() in the trunk and the issue seems to be gone. Thanks. On Fri Dec 24 14:56:42 2010, ISHIGAKI wrote: Show quoted text
> Well, actually DBD::SQLite does nothing about "ping". The method is > from DBI, and it somehow does not do the right thing (the same thing > happens when you use DBD::Sponge). Could you report this to the DBI's > tracker? > > Thanks, > > Kenichi > > On Thu Dec 23 10:59:05 2010, VLYON wrote:
> > According to DBI the ping() method won't affect the errstr from a > > previous error. > > http://search.cpan.org/perldoc?DBI#err > > > > However in DBD::SQLite it wipes it out and sets the errstr to undef! > > > > Diff to test for it: > > > > Index: DBD-SQLite/t/07_error.t > > =================================================================== > > --- DBD-SQLite/t/07_error.t (revision 13493) > > +++ DBD-SQLite/t/07_error.t (working copy) > > @@ -7,7 +7,7 @@ > > } > > > > use t::lib::Test; > > -use Test::More tests => 8; > > +use Test::More tests => 9; > > use Test::NoWarnings; > > > > my $dbh = connect_ok( RaiseError => 1, PrintError => 0 ); > > @@ -18,6 +18,9 @@ > > is( $DBI::err, 1, '$DBI::err ok' ); > > is( $DBI::errstr, 'near "ssdfsdf": syntax error', '$DBI::errstr
> ok' );
> > > > +$dbh->ping; # ping() should not clear the errstr! > > +is $dbh->errstr, 'near "ssdfsdf": syntax error', '$dbh->ping does
not Show quoted text
> > clear the error'; > > + > > $dbh->do('create table testerror (a, b)'); > > $dbh->do('insert into testerror values (1, 2)'); > > $dbh->do('insert into testerror values (3, 4)');
> >