Skip Menu |

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

Report information
The Basics
Id: 92212
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: felliott [...] fiskur.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 3.0.0



Subject: [PATCH] Tests leaving behind entries in pg_largeobject
Hello! Each time DBD::Pg is tested, it adds four entries to the pg_largeobject catalog that never get removed. The attached patch specifically removes those four los after they are no longer needed. Please let me know if you'd like me to make any changes to the patch. Thanks for your hard work in maintaining DBD::Pg! Cheers, Fitz Elliott
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.
From: felliott [...] fiskur.org
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
Subject: 0001-cleanup-dangling-largeobjects-in-tests.patch
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
Thanks! Looks good, applied in e492aaec92045ae09dcb3997c8a6caf31f189c00