diff options
author | lpsolit%gmail.com <> | 2007-11-19 03:20:53 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-11-19 03:20:53 +0100 |
commit | 9d6205cdb651fe3769ac58f03068dedb68e7689a (patch) | |
tree | 47414a6cf3f484e27a74fe91842ebe08843bb2c5 /Bugzilla/Install | |
parent | 0dadaed4ffb582ccfbc2356e7715007819d1cea2 (diff) | |
download | bugzilla-9d6205cdb651fe3769ac58f03068dedb68e7689a.tar.gz bugzilla-9d6205cdb651fe3769ac58f03068dedb68e7689a.tar.xz |
Bug 399163: Bugzilla/*.pm should use transactions for database interaction - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r-- | Bugzilla/Install/DB.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 327487cd9..9934e058f 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -659,8 +659,9 @@ sub _populate_longdescs { " for each 50.\n\n"; local $| = 1; - $dbh->bz_lock_tables('bugs write', 'longdescs write', 'profiles write', - 'bz_schema WRITE'); + # On MySQL, longdescs doesn't benefit from transactions, but this + # doesn't hurt. + $dbh->bz_start_transaction(); $dbh->do('DELETE FROM longdescs'); @@ -722,7 +723,7 @@ sub _populate_longdescs { print "\n\n"; $dbh->bz_drop_column('bugs', 'long_desc'); - $dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); } # main if } @@ -740,8 +741,7 @@ sub _update_bugs_activity_field_to_fieldid { [qw(fieldid)]); print "Populating new bugs_activity.fieldid field...\n"; - $dbh->bz_lock_tables('bugs_activity WRITE', 'fielddefs WRITE'); - + $dbh->bz_start_transaction(); my $ids = $dbh->selectall_arrayref( 'SELECT DISTINCT fielddefs.id, bugs_activity.field @@ -760,7 +760,7 @@ sub _update_bugs_activity_field_to_fieldid { $dbh->do("UPDATE bugs_activity SET fieldid = ? WHERE field = ?", undef, $id, $field); } - $dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); $dbh->bz_drop_column('bugs_activity', 'field'); } |