]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 239263: Avoid hazard in User->groups by switching to main DB for rederive
authorbugreport%peshkin.net <>
Fri, 14 May 2004 20:55:45 +0000 (20:55 +0000)
committerbugreport%peshkin.net <>
Fri, 14 May 2004 20:55:45 +0000 (20:55 +0000)
r=jouni
a=justdave

Bugzilla/User.pm

index 50a4e62b7d365c0d967143773f1646c590141ab5..c9535d7bf48a0d1c88a15f71557e7b0e4796b657 100644 (file)
@@ -107,7 +107,14 @@ sub _create {
                                        $id);
 
     if ($result) {
+        my $is_main_db;
+        unless ($is_main_db = Bugzilla->dbwritesallowed()) {
+            Bugzilla->switch_to_main_db();
+        }
         $self->derive_groups($tables_locked_for_derive_groups);
+        unless ($is_main_db) {
+            Bugzilla->switch_to_shadow_db();
+        }
     }
 
     return $self;