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 /request.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 'request.cgi')
-rwxr-xr-x | request.cgi | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/request.cgi b/request.cgi index 7f3e6351c..36f6c9ce7 100755 --- a/request.cgi +++ b/request.cgi @@ -92,33 +92,34 @@ sub queue { # so we can display product and component names, and the bug_group_map # and user_group_map tables to help us weed out secure bugs to which # the user should not have access. - " FROM flags - LEFT JOIN attachments ON ($attach_join_clause), - flagtypes, - profiles AS requesters - LEFT JOIN profiles AS requestees - ON flags.requestee_id = requestees.userid, - bugs - LEFT JOIN products ON bugs.product_id = products.id - LEFT JOIN components ON bugs.component_id = components.id - LEFT JOIN bug_group_map AS bgmap - ON bgmap.bug_id = bugs.bug_id - LEFT JOIN user_group_map AS ugmap - ON bgmap.group_id = ugmap.group_id - AND ugmap.user_id = $::userid + " FROM flags + LEFT JOIN attachments + ON ($attach_join_clause) + INNER JOIN flagtypes + ON flags.type_id = flagtypes.id + INNER JOIN profiles AS requesters + ON flags.setter_id = requesters.userid + LEFT JOIN profiles AS requestees + ON flags.requestee_id = requestees.userid + INNER JOIN bugs + ON flags.bug_id = bugs.bug_id + LEFT JOIN products + ON bugs.product_id = products.id + LEFT JOIN components + ON bugs.component_id = components.id + LEFT JOIN bug_group_map AS bgmap + ON bgmap.bug_id = bugs.bug_id + LEFT JOIN user_group_map AS ugmap + ON bgmap.group_id = ugmap.group_id + AND ugmap.user_id = $::userid AND ugmap.isbless = 0 - LEFT JOIN cc AS ccmap - ON ccmap.who = $::userid AND ccmap.bug_id = bugs.bug_id - " . - # All of these are inner join clauses. Actual match criteria are added - # in the code below. - " WHERE flags.type_id = flagtypes.id - AND flags.setter_id = requesters.userid - AND flags.bug_id = bugs.bug_id + LEFT JOIN cc AS ccmap + ON ccmap.who = $::userid + AND ccmap.bug_id = bugs.bug_id "; # Non-deleted flags only - $query .= " AND flags.is_active = 1 "; + $query .= " WHERE flags.is_active = 1 "; # Limit query to pending requests. $query .= " AND flags.status = '?' " unless $cgi->param('status'); |