From f5f31fc070588c2075dd13a0fbabe8117e3aad76 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Tue, 5 Apr 2005 04:52:03 +0000 Subject: Bug 286235: Implicit joins should be replaced by explicit joins - installment A Patch By Tomas Kopal r=joel, a=myk --- attachment.cgi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 65157d740..fadbe8b97 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -265,9 +265,10 @@ sub validateCanChangeAttachment { my ($attachid) = @_; SendSQL("SELECT product_id - FROM attachments, bugs - WHERE attach_id = $attachid - AND bugs.bug_id = attachments.bug_id"); + FROM attachments + INNER JOIN bugs + ON bugs.bug_id = attachments.bug_id + WHERE attach_id = $attachid"); my $productid = FetchOneColumn(); CanEditProductId($productid) || ThrowUserError("illegal_attachment_edit", @@ -993,9 +994,11 @@ sub insert my @fields = ("assigned_to", "bug_status", "resolution", "login_name"); # Get the old values, for the bugs_activity table - SendSQL("SELECT " . join(", ", @fields) . " FROM bugs, profiles " . - "WHERE bugs.bug_id = $::FORM{'bugid'} " . - "AND profiles.userid = bugs.assigned_to"); + SendSQL("SELECT " . join(", ", @fields) . " " . + "FROM bugs " . + "INNER JOIN profiles " . + "ON profiles.userid = bugs.assigned_to " . + "WHERE bugs.bug_id = $::FORM{'bugid'}"); my @oldvalues = FetchSQLData(); my @newvalues = ($::userid, "ASSIGNED", "", DBID_to_name($::userid)); -- cgit v1.2.3-24-g4f1b