summaryrefslogtreecommitdiff
path: root/FS/FS/Cursor.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/Cursor.pm')
-rw-r--r--FS/FS/Cursor.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/Cursor.pm b/FS/FS/Cursor.pm
index ec7af93c1..6d02a16ad 100644
--- a/FS/FS/Cursor.pm
+++ b/FS/FS/Cursor.pm
@@ -57,7 +57,7 @@ sub new {
my $sth = dbh->prepare($statement)
or die dbh->errstr;
- my $bind = 0;
+ my $bind = 1;
foreach my $value ( @{ $q->{value} } ) {
my $bind_type = shift @{ $q->{bind_type} };
$sth->bind_param($bind++, $value, $bind_type );
@@ -108,6 +108,12 @@ sub DESTROY {
dbh->do('CLOSE '. $self->{id}) or die dbh->errstr; # clean-up the cursor in Pg
}
+sub DESTROY {
+ my $self = shift;
+ my $statement = "CLOSE ".$self->{id};
+ dbh->do($statement);
+}
+
=back
=head1 TO DO