Commit info for scoop/lib/Scoop:
Modified Files:
Tag: CURRENT
DB.pm
Log Message:
Once again, trying to get CURRENT synced with the main Scoop branch. -j
Index: DB.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/DB.pm,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -r1.21.2.2 -r1.21.2.3
32,33d31
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
168,169d165
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
204,205d199
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
242,243d235
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
275,276d266
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
297c287
< if ($args->{DEBUG} || $DEBUG) {warn "in db_unlock_tables: Query is $query\n";}
---
> if ($args->{DEBUG} || $DEBUG) {warn "in db_unlock_tables: Query is $query\n"};
302,303d291
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
314,406d301
< }
<
< # Add functions for transactions. Can only be used with versions of mysql
< # that use transactions, of course.
<
< sub db_start_transaction {
< my $S = shift;
< my $args = shift;
<
< unless ($S->{CONFIG}->{mysql_version} =~ /^4/) {
< return "Transactions not supported in this version of MySQL.\n";
< }
< $Scoop::DB_QUERY_COUNT++ if ($Scoop::COUNT_DEBUG);
<
< my $query = "START TRANSACTION";
<
< if ($args->{DEBUG} || $DEBUG) {warn "in db_start_transaction: Query is $query\n";}
<
< my $dbh;
< if ($args->{ARCHIVE}) {
< $dbh = $S->{DBHARCHIVE};
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
< } else {
< $dbh = $S->{DBH};
< }
< return('0E0',undef) unless ($dbh);
<
< my $sth = $dbh->prepare($query);
< my $rv = $sth->execute();
<
< warn "<<ERROR>> in db_start_transaction: $DBI::errstr (Query is $query)\n" unless $rv;
< return ($rv, $sth);
< }
<
< sub db_commit {
< my $S = shift;
< my $args = shift;
<
< unless ($S->{CONFIG}->{mysql_version} =~ /^4/) {
< return "Transactions not supported in this version of MySQL.\n";
< }
< $Scoop::DB_QUERY_COUNT++ if ($Scoop::COUNT_DEBUG);
<
< my $query = "COMMIT";
<
< if ($args->{DEBUG} || $DEBUG) {warn "in db_commit: Query is $query\n";}
<
< my $dbh;
< if ($args->{ARCHIVE}) {
< $dbh = $S->{DBHARCHIVE};
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
< } else {
< $dbh = $S->{DBH};
< }
< return('0E0',undef) unless ($dbh);
<
< my $sth = $dbh->prepare($query);
< my $rv = $sth->execute();
<
< warn "<<ERROR>> in db_commit: $DBI::errstr (Query is $query)\n" unless $rv;
< return ($rv, $sth);
< }
<
< sub db_rollback {
< my $S = shift;
< my $args = shift;
<
< unless ($S->{CONFIG}->{mysql_version} =~ /^4/) {
< return "Transactions not supported in this version of MySQL.\n";
< }
< $Scoop::DB_QUERY_COUNT++ if ($Scoop::COUNT_DEBUG);
<
< my $query = "ROLLBACK";
<
< if ($args->{DEBUG} || $DEBUG) {warn "in db_rollback: Query is $query\n";}
<
< my $dbh;
< if ($args->{ARCHIVE}) {
< $dbh = $S->{DBHARCHIVE};
< } elsif ($args->{SHARED_USER}) {
< $dbh = $S->{SHARED_USER_DB};
< } else {
< $dbh = $S->{DBH};
< }
< return('0E0',undef) unless ($dbh);
<
< my $sth = $dbh->prepare($query);
< my $rv = $sth->execute();
<
< warn "<<ERROR>> in db_rollback: $DBI::errstr (Query is $query)\n" unless $rv;
< return ($rv, $sth);