diff options
author | mkanat%kerio.com <> | 2005-03-10 16:59:48 +0100 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-03-10 16:59:48 +0100 |
commit | c4804fb41628501553714fd98d0078d05353e930 (patch) | |
tree | a9d75b289b9a3dbdf0f9c1d616f9a1a51687eed4 /Bugzilla/DB | |
parent | a46f353a0a226e45a80be2dd07adc78128f4df03 (diff) | |
download | bugzilla-c4804fb41628501553714fd98d0078d05353e930.tar.gz bugzilla-c4804fb41628501553714fd98d0078d05353e930.tar.xz |
Bug 285397: Untested parts of Bugzilla::DB are broken (when running on PostgreSQL)
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=Tomas.Kopal, a=justdave
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r-- | Bugzilla/DB/Mysql.pm | 3 | ||||
-rw-r--r-- | Bugzilla/DB/Pg.pm | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 14230b188..33354cb44 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -42,7 +42,6 @@ package Bugzilla::DB::Mysql; use strict; use Bugzilla::Error; -use Carp; # This module extends the DB interface via inheritance use base qw(Bugzilla::DB); @@ -149,7 +148,6 @@ sub bz_lock_tables { # Check first if there was no lock before if ($self->{private_bz_tables_locked}) { - carp("Tables already locked"); ThrowCodeError("already_locked"); } else { $self->do('LOCK TABLE ' . join(', ', @tables)); @@ -165,7 +163,6 @@ sub bz_unlock_tables { if (!$self->{private_bz_tables_locked}) { # Abort is allowed even without previous lock for error handling return if $abort; - carp("No matching lock"); ThrowCodeError("no_matching_lock"); } else { $self->do("UNLOCK TABLES"); diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 2ec3000d5..de3260e7a 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -42,7 +42,6 @@ package Bugzilla::DB::Pg; use strict; use Bugzilla::Error; -use Carp; # This module extends the DB interface via inheritance use base qw(Bugzilla::DB); @@ -146,7 +145,6 @@ sub bz_lock_tables { # Check first if there was no lock before if ($self->{private_bz_tables_locked}) { - carp("Tables already locked"); ThrowCodeError("already_locked"); } else { my %read_tables; @@ -173,6 +171,7 @@ sub bz_lock_tables { ' IN ROW SHARE MODE') if keys %read_tables; Bugzilla->dbh->do('LOCK TABLE ' . join(', ', keys %write_tables) . ' IN ROW EXCLUSIVE MODE') if keys %write_tables; + $self->{private_bz_tables_locked} = 1; } } @@ -183,10 +182,9 @@ sub bz_unlock_tables { if (!$self->{private_bz_tables_locked}) { # Abort is allowed even without previous lock for error handling return if $abort; - - carp("No matching lock"); ThrowCodeError("no_matching_lock"); } else { + $self->{private_bz_tables_locked} = 0; # End transaction, tables will be unlocked automatically if ($abort) { $self->bz_rollback_transaction(); |