projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1e4e2c
)
but don't break Pg cursors in the process, #28895
author
Mark Wells
<mark@freeside.biz>
Fri, 13 Jun 2014 19:48:02 +0000
(12:48 -0700)
committer
Mark Wells
<mark@freeside.biz>
Fri, 13 Jun 2014 19:48:02 +0000
(12:48 -0700)
FS/FS/Cursor.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Cursor.pm
b/FS/FS/Cursor.pm
index
3af3c1b
..
f6d8816
100644
(file)
--- a/
FS/FS/Cursor.pm
+++ b/
FS/FS/Cursor.pm
@@
-77,13
+77,13
@@
sub new {
}
$sth->execute or die $sth->errstr;
}
$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' ) {
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");
}
$self->{fetch} = $dbh->prepare("SELECT * FROM $self->{id} ORDER BY rownum LIMIT ?, $buffer");
}