Subject: | DBD::Pg 1.41: Rollback does not reset copy state |
We have a test suite which includes a test which deliberately dies in the middle of a loop doing copy. The test does rolls back the dbh but every later operation on the dbh fails with:
Must call pg_endcopy before issuing more commands at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/Pg.pm line 203.
The expected behavior is that rollback() resets the copystate flag. It should not leave the database handle in a state where an explicit pg_endcopy must be called.
eval {
$dbh->do("CREATE TEMPORARY TABLE foo ( bar INTEGER )");
$dbh->do("COPY foo FROM STDIN");
$dbh->pg_putline("1\n");
die;
$dbh->pg_endcopy();
};
warn $@;
$dbh->rollback();
$dbh->do("SELECT 1");
This prints:
Something else went wrong
Must call pg_endcopy before issuing more commands at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/Pg.pm line 203.