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 /attachment.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 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 15 |
1 files changed, 9 insertions, 6 deletions
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)); |