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)');