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.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/FS/FS/Cursor.pm b/FS/FS/Cursor.pm
index 3af3c1bff..f6d8816a7 100644
--- a/FS/FS/Cursor.pm
+++ b/FS/FS/Cursor.pm
@@ -77,13 +77,13 @@ sub new {
}
$sth->execute or die $sth->errstr;
- # in mysql, make sure we're not holding any locks on the tables mentioned
- # in the query; in Pg this will do nothing.
- $dbh->commit;
if ( driver_name() eq 'Pg' ) {
$self->{fetch} = $dbh->prepare("FETCH FORWARD $buffer FROM ".$self->{id});
} elsif ( driver_name() eq 'mysql' ) {
+ # make sure we're not holding any locks on the tables mentioned
+ # in the query
+ $dbh->commit if driver_name() eq 'mysql';
$self->{fetch} = $dbh->prepare("SELECT * FROM $self->{id} ORDER BY rownum LIMIT ?, $buffer");
}