From e9024051f9835fef0a0ca5223b1ce46098f4a14a Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 3 Aug 2009 05:14:39 +0000 Subject: Bug 405970: Make checksetup.pl not rederive regex groups every time it runs (this was significantly slowing down checksetup.pl on large installations when there was nothing to do) Patch by Max Kanat-Alexander (module owner) a=mkanat --- Bugzilla/Install.pm | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'Bugzilla/Install.pm') diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index c469aa857..a32063ca7 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -185,36 +185,6 @@ sub update_system_groups { $dbh->do('INSERT INTO group_group_map (grantor_id, member_id) VALUES (?,?)', undef, $sudo_protect->id, $sudo->id); } - - # Re-evaluate all regexps, to keep them up-to-date. - my $sth = $dbh->prepare( - "SELECT profiles.userid, profiles.login_name, groups.id, - groups.userregexp, user_group_map.group_id - FROM (profiles CROSS JOIN groups) - LEFT JOIN user_group_map - ON user_group_map.user_id = profiles.userid - AND user_group_map.group_id = groups.id - AND user_group_map.grant_type = ? - WHERE userregexp != '' OR user_group_map.group_id IS NOT NULL"); - - my $sth_add = $dbh->prepare( - "INSERT INTO user_group_map (user_id, group_id, isbless, grant_type) - VALUES (?, ?, 0, " . GRANT_REGEXP . ")"); - - my $sth_del = $dbh->prepare( - "DELETE FROM user_group_map - WHERE user_id = ? AND group_id = ? AND isbless = 0 - AND grant_type = " . GRANT_REGEXP); - - $sth->execute(GRANT_REGEXP); - while (my ($uid, $login, $gid, $rexp, $present) = $sth->fetchrow_array()) { - if ($login =~ m/$rexp/i) { - $sth_add->execute($uid, $gid) unless $present; - } else { - $sth_del->execute($uid, $gid) if $present; - } - } - } sub create_default_classification { -- cgit v1.2.3-24-g4f1b