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 f3bc1e23d..f59d8cbb0 100644
--- a/FS/FS/Cursor.pm
+++ b/FS/FS/Cursor.pm
@@ -56,7 +56,7 @@ sub new {
my $dbh = dbh;
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 );
@@ -101,6 +101,12 @@ sub refill {
scalar @$result;
}
+sub DESTROY {
+ my $self = shift;
+ my $statement = "CLOSE ".$self->{id};
+ dbh->do($statement);
+}
+
=back
=head1 TO DO