diff options
author | mkanat%bugzilla.org <> | 2009-08-03 15:13:50 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-08-03 15:13:50 +0000 |
commit | 4d04866100b1566d062f7b10c561877c49a9c6a5 (patch) | |
tree | f36fdae658ab58c9fc612410cabfc05ac9f52d3d /Bugzilla | |
parent | 4d94e4169a9aeb1f2ccde25b2c7debffe6f82cbe (diff) | |
download | bugs-4d04866100b1566d062f7b10c561877c49a9c6a5.tar bugs-4d04866100b1566d062f7b10c561877c49a9c6a5.tar.gz bugs-4d04866100b1566d062f7b10c561877c49a9c6a5.tar.bz2 bugs-4d04866100b1566d062f7b10c561877c49a9c6a5.tar.xz bugs-4d04866100b1566d062f7b10c561877c49a9c6a5.zip |
Bug 508032: Speed up initializing of email_setting values
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Install/DB.pm | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 09b110894..48fc06630 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -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 { |