]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 305126: Fix table locks after removal of derive_groups
authorbugreport%peshkin.net <>
Tue, 30 Aug 2005 23:04:39 +0000 (23:04 +0000)
committerbugreport%peshkin.net <>
Tue, 30 Aug 2005 23:04:39 +0000 (23:04 +0000)
Patch by Joel Peshkin <bugreport@peshkin.net>
r=lpsolit, a=myk

attachment.cgi
post_bug.cgi
process_bug.cgi
votes.cgi
whine.pl

index 86cd1698d32a6c7aa4704404eb12e9f64a3a4261..c406516a3a3639b487a4cfcf92a699b038bdf1a5 100755 (executable)
@@ -1190,12 +1190,10 @@ sub update
           # cc, bug_group_map, user_group_map, and groups are in here so we
           # can check the permissions of flag requestees and email addresses
           # on the flag type cc: lists via the CanSeeBug
-          # function call in Flag::notify. group_group_map is in here in case
-          # Bugzilla::User needs to rederive groups. profiles and 
-          # user_group_map would be READ locks instead of WRITE locks if it
-          # weren't for derive_groups, which needs to write to those tables.
-          'bugs WRITE', 'profiles WRITE', 'email_setting READ',
-          'cc READ', 'bug_group_map READ', 'user_group_map WRITE',
+          # function call in Flag::notify. group_group_map is in here si
+          # Bugzilla::User can flatten groups.
+          'bugs WRITE', 'profiles READ', 'email_setting READ',
+          'cc READ', 'bug_group_map READ', 'user_group_map READ',
           'group_group_map READ', 'groups READ');
 
   # Get a copy of the attachment record before we make changes
index 77f076139504f7d5c915fe84d67652fca629755d..f32ef9b1475a27d89129f8f22e018aa18c8e4729 100755 (executable)
@@ -370,7 +370,8 @@ while (MoreSQLData()) {
 # Add the bug report to the DB.
 $dbh->bz_lock_tables('bugs WRITE', 'bug_group_map WRITE', 'longdescs WRITE',
                      'cc WRITE', 'keywords WRITE', 'dependencies WRITE',
-                     'bugs_activity WRITE', 'groups READ', 'user_group_map READ',
+                     'bugs_activity WRITE', 'groups READ',
+                     'user_group_map READ', 'group_group_map READ',
                      'keyworddefs READ', 'fielddefs READ');
 
 SendSQL($sql);
index b60f5aa6061d0ee989d064bb8629e6fea15a49bf..8f325dd61149d8fccbb917bce7b97007daafee1f 100755 (executable)
@@ -620,8 +620,6 @@ if ($action eq Param('move-button-text')) {
     $comment .= "If all went well,  please mark this bug verified, and paste\n";
     $comment .= "in a link to the new bug. Otherwise, reopen this bug.\n";
 
-    # $user->derive_groups() has already been called by Bugzilla->login(),
-    # so the related tables do not need to be locked.
     $dbh->bz_lock_tables('bugs WRITE', 'bugs_activity WRITE', 'duplicates WRITE',
                          'longdescs WRITE', 'profiles READ', 'groups READ',
                          'bug_group_map READ', 'group_group_map READ',
@@ -1266,16 +1264,11 @@ foreach my $id (@idlist) {
                                 # whether we do LOW_PRIORITY ...
     $dbh->bz_lock_tables("bugs $write", "bugs_activity $write",
             "cc $write", "cc AS selectVisible_cc $write",
-            "profiles $write", "dependencies $write", "votes $write",
+            "profiles READ", "dependencies $write", "votes $write",
             "products READ", "components READ",
             "keywords $write", "longdescs $write", "fielddefs $write",
             "bug_group_map $write", "flags $write", "duplicates $write",
-            # user_group_map would be a READ lock except that Flag::process
-            # may call Flag::notify, which creates a new user object,
-            # which might call derive_groups, which wants a WRITE lock on that
-            # table. group_group_map is in here at all because derive_groups
-            # needs it.
-            "user_group_map $write", "group_group_map READ", "flagtypes READ",
+            "user_group_map READ", "group_group_map READ", "flagtypes READ",
             "flaginclusions AS i READ", "flagexclusions AS e READ",
             "keyworddefs READ", "groups READ", "attachments READ",
             "group_control_map AS oldcontrolmap READ",
index 13f1ec7e265f70dfe8b7d2b8b3593fd4c42cf200..b4401a373680d0c915735012d960da09e6451c98 100755 (executable)
--- a/votes.cgi
+++ b/votes.cgi
@@ -134,6 +134,7 @@ sub show_user {
 
     $dbh->bz_lock_tables('bugs READ', 'products READ', 'votes WRITE',
              'cc READ', 'bug_group_map READ', 'user_group_map READ',
+             'group_group_map READ',
              'cc AS selectVisible_cc READ', 'groups READ');
 
     if ($canedit && $bug_id) {
index c4a4547759f9f5dec2d832f5e70a451d5fb23309..068774ca0fa12529998692a354fe9b2fa775b872 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
@@ -228,10 +228,10 @@ sub get_next_event {
 
         $dbh->bz_lock_tables('whine_schedules WRITE',
                              'whine_events READ',
-                             'profiles WRITE',
+                             'profiles READ',
                              'groups READ',
                              'group_group_map READ',
-                             'user_group_map WRITE');
+                             'user_group_map READ');
 
         # Get the event ID for the first pending schedule
         $sth_next_scheduled_event->execute;