diff options
author | mkanat%kerio.com <> | 2005-04-05 04:52:03 +0000 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-04-05 04:52:03 +0000 |
commit | f5f31fc070588c2075dd13a0fbabe8117e3aad76 (patch) | |
tree | 4a3bb48995143c84fcb8f222b420814e1c6e8eaf /buglist.cgi | |
parent | Bug 287483: Sanitycheck screams about "Bad value 0 found in components.initia... (diff) | |
download | bugzilla-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.gz bugzilla-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.bz2 bugzilla-f5f31fc070588c2075dd13a0fbabe8117e3aad76.zip |
Bug 286235: Implicit joins should be replaced by explicit joins - installment A
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=joel, a=myk
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/buglist.cgi b/buglist.cgi index d6567852b..cfcefee90 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -307,9 +307,11 @@ sub GetGroupsByUserId { # the columns for that row. my $groups = $dbh->selectall_arrayref( "SELECT DISTINCT groups.id, name, description, isactive - FROM groups, user_group_map - WHERE user_id = ? AND isbless = 0 - AND user_group_map.group_id = groups.id + FROM groups + INNER JOIN user_group_map + ON user_group_map.group_id = groups.id + WHERE user_id = ? + AND isbless = 0 AND isbuggroup = 1 ORDER BY description " , {Slice => {}}, ($userid)); @@ -873,14 +875,15 @@ while (my @row = $buglist_sth->fetchrow_array()) { # or because of human choice my %min_membercontrol; if (@bugidlist) { - my $sth = $dbh->prepare("SELECT DISTINCT bugs.bug_id, " . - "MIN(group_control_map.membercontrol) " . - "FROM bugs, bug_group_map " . - "LEFT JOIN group_control_map " . - "ON group_control_map.product_id=bugs.product_id " . - "AND group_control_map.group_id=bug_group_map.group_id " . - "WHERE bugs.bug_id = bug_group_map.bug_id " . - "AND bugs.bug_id IN (" . join(',',@bugidlist) . ") " . + my $sth = $dbh->prepare(
+ "SELECT DISTINCT bugs.bug_id, MIN(group_control_map.membercontrol) " . + "FROM bugs " . + "INNER JOIN bug_group_map " . + "ON bugs.bug_id = bug_group_map.bug_id " . + "LEFT JOIN group_control_map " . + "ON group_control_map.product_id = bugs.product_id " . + "AND group_control_map.group_id = bug_group_map.group_id " . + "WHERE bugs.bug_id IN (" . join(',',@bugidlist) . ") " . $dbh->sql_group_by('bugs.bug_id')); $sth->execute(); while (my ($bug_id, $min_membercontrol) = $sth->fetchrow_array()) { |