On Thu Jan 16 16:35:08 2014, TURNSTEP wrote:
Show quoted text> Thanks, good idea, but I don't see the patch. Could you try to reload
> it to this ticket please? If that is not working, feel free to email
> it to me direct.
Doh! I'm the dum-dum who forgot to attach it. Here you go, and thanks!
Cheers,
Fitz
From d9b591e6d26db0931a6336e50992aaf92dd43808 Mon Sep 17 00:00:00 2001
From: Fitz Elliott <felliott@fiskur.org>
Date: Thu, 16 Jan 2014 16:01:31 -0500
Subject: [PATCH] cleanup dangling largeobjects in tests
diff --git a/t/03dbmethod.t b/t/03dbmethod.t
index b64ea80..ff4c4eb 100644
--- a/t/03dbmethod.t
+++ b/t/03dbmethod.t
@@ -1535,6 +1535,7 @@ SKIP: {
$thandle = $dbh->pg_lo_import_with_oid($filename, 0);
};
ok ($thandle, $t);
+ $dbh->rollback();
}
unlink $filename;
@@ -1560,6 +1561,7 @@ SKIP: {
is ($data, "abc\ndef", $t);
close $fh or warn 'Could not close tempfile';
unlink $filename;
+ $dbh->pg_lo_unlink($objid);
}
## Same pg_lo_* tests, but with AutoCommit on
@@ -1637,6 +1639,11 @@ SKIP: {
$info = $sth->fetchall_arrayref()->[0][0];
is_deeply ($info, "abc\ndef", $t);
+ # cleanup last lo
+ $dbh->{AutoCommit} = 0;
+ $dbh->pg_lo_unlink($handle);
+ $dbh->{AutoCommit} = 1;
+
$t='DB handle method "pg_lo_import" works (AutoCommit on, begin_work called, no command)';
$dbh->begin_work();
$handle = $dbh->pg_lo_import($filename);
@@ -1708,6 +1715,11 @@ SKIP: {
is ($data, "abc\ndef", $t);
close $fh or warn 'Could not close tempfile';
unlink $filename;
+
+ # cleanup last lo
+ $dbh->{AutoCommit} = 0;
+ $dbh->pg_lo_unlink($handle);
+ $dbh->{AutoCommit} = 1;
}
$dbh->{AutoCommit} = 0;
--
1.8.5.3