summaryrefslogtreecommitdiffstats
path: root/editproducts.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-05-03 03:52:02 +0200
committermkanat%kerio.com <>2005-05-03 03:52:02 +0200
commit9d202f2d562c0cb8299c832158811f2131c73e27 (patch)
tree97f5a0406de60ca7da9fffe0fd1cd459c6c0a201 /editproducts.cgi
parent95859bf15300cddd1ece82e8224367638f956f20 (diff)
downloadbugzilla-9d202f2d562c0cb8299c832158811f2131c73e27.tar.gz
bugzilla-9d202f2d562c0cb8299c832158811f2131c73e27.tar.xz
Bug 289043: Implicit joins should be replaced by explicit joins - installment C
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=joel, a=justdave
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-xeditproducts.cgi23
1 files changed, 12 insertions, 11 deletions
diff --git a/editproducts.cgi b/editproducts.cgi
index ac54ab517..be0842912 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -336,14 +336,14 @@ if (!$action && !$product) {
FROM products";
if (Param('useclassification')) {
- $query .= ", classifications";
+ $query .= " INNER JOIN classifications " .
+ "ON classifications.id = products.classification_id";
}
$query .= " LEFT JOIN bugs ON products.id = bugs.product_id";
if (Param('useclassification')) {
- $query .= " WHERE classifications.name = ? " .
- " AND classifications.id = products.classification_id";
+ $query .= " WHERE classifications.name = ? ";
# trick_taint is OK because we use this in a placeholder in a SELECT
trick_taint($classification);
@@ -1038,14 +1038,15 @@ if ($action eq 'updategroupcontrols') {
my @mandatory_groups = ();
if (@now_mandatory) {
SendSQL("SELECT groups.name, COUNT(bugs.bug_id)
- FROM bugs, groups
- LEFT JOIN bug_group_map
- ON bug_group_map.group_id = groups.id
- AND bug_group_map.bug_id = bugs.bug_id
- WHERE groups.id IN(" . join(', ', @now_mandatory) . ")
- AND bugs.product_id = $product_id
- AND bug_group_map.bug_id IS NULL " .
- $dbh->sql_group_by('groups.name'));
+ FROM bugs
+ LEFT JOIN bug_group_map
+ ON bug_group_map.bug_id = bugs.bug_id
+ INNER JOIN groups
+ ON bug_group_map.group_id = groups.id
+ WHERE groups.id IN(" . join(', ', @now_mandatory) . ")
+ AND bugs.product_id = $product_id
+ AND bug_group_map.bug_id IS NULL " .
+ $dbh->sql_group_by('groups.name'));
while (MoreSQLData()) {
my ($groupname, $bugcount) = FetchSQLData();
my %g = ();