aboutsummaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-04-05 04:52:03 +0000
committermkanat%kerio.com <>2005-04-05 04:52:03 +0000
commitf5f31fc070588c2075dd13a0fbabe8117e3aad76 (patch)
tree4a3bb48995143c84fcb8f222b420814e1c6e8eaf /attachment.cgi
parentd71d64d9372f1556cec96434179b4cb1f9668e92 (diff)
downloadbugs-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar
bugs-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.gz
bugs-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.bz2
bugs-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.xz
bugs-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-xattachment.cgi15
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));