summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Mysql.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-07-08 06:15:20 +0200
committerlpsolit%gmail.com <>2005-07-08 06:15:20 +0200
commit230976efc0233c7157f6b6a3919e5eb885dbe4a7 (patch)
tree2cadf7119883a3d6293daba9c228791689e17186 /Bugzilla/DB/Mysql.pm
parent6e29c7cd06afac55962dac20421bddbf17954906 (diff)
downloadbugzilla-230976efc0233c7157f6b6a3919e5eb885dbe4a7.tar.gz
bugzilla-230976efc0233c7157f6b6a3919e5eb885dbe4a7.tar.xz
Bug 299212: "already locked" errors should be more informative - Patch by Frédéric Buclin <LpSolit@gmail.com> r=glob a=justdave
Diffstat (limited to 'Bugzilla/DB/Mysql.pm')
-rw-r--r--Bugzilla/DB/Mysql.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 832034a97..3472a351d 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -64,7 +64,7 @@ sub new {
# all class local variables stored in DBI derived class needs to have
# a prefix 'private_'. See DBI documentation.
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
bless ($self, $class);
@@ -159,13 +159,15 @@ sub sql_group_by {
sub bz_lock_tables {
my ($self, @tables) = @_;
+ my $list = join(', ', @tables);
# Check first if there was no lock before
if ($self->{private_bz_tables_locked}) {
- ThrowCodeError("already_locked");
+ ThrowCodeError("already_locked", { current => $self->{private_bz_tables_locked},
+ new => $list });
} else {
- $self->do('LOCK TABLE ' . join(', ', @tables));
+ $self->do('LOCK TABLE ' . $list);
- $self->{private_bz_tables_locked} = 1;
+ $self->{private_bz_tables_locked} = $list;
}
}
@@ -180,7 +182,7 @@ sub bz_unlock_tables {
} else {
$self->do("UNLOCK TABLES");
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
}
}