Commit 4d048661 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 508032: Speed up initializing of email_setting values

Patch by Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
parent 4d94e416
......@@ -2222,17 +2222,9 @@ sub _clone_email_event {
my ($source, $target) = @_;
my $dbh = Bugzilla->dbh;
my $sth1 = $dbh->prepare("SELECT user_id, relationship FROM email_setting
WHERE event = $source");
my $sth2 = $dbh->prepare("INSERT into email_setting " .
"(user_id, relationship, event) VALUES (" .
"?, ?, $target)");
$sth1->execute();
while (my ($userid, $relationship) = $sth1->fetchrow_array()) {
$sth2->execute($userid, $relationship);
}
$dbh->do("INSERT INTO email_setting (user_id, relationship, event)
SELECT user_id, relationship, $target FROM email_setting
WHERE event = $source");
}
sub _migrate_email_prefs_to_new_table {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment