summaryrefslogtreecommitdiffstats
path: root/votes.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-04-05 06:52:03 +0200
committermkanat%kerio.com <>2005-04-05 06:52:03 +0200
commitf5f31fc070588c2075dd13a0fbabe8117e3aad76 (patch)
tree4a3bb48995143c84fcb8f222b420814e1c6e8eaf /votes.cgi
parentd71d64d9372f1556cec96434179b4cb1f9668e92 (diff)
downloadbugzilla-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.gz
bugzilla-f5f31fc070588c2075dd13a0fbabe8117e3aad76.tar.xz
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 'votes.cgi')
-rwxr-xr-xvotes.cgi19
1 files changed, 10 insertions, 9 deletions
diff --git a/votes.cgi b/votes.cgi
index 3a22c90b0..128dcba81 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -95,9 +95,9 @@ sub show_bug {
my @users;
SendSQL("SELECT profiles.login_name, votes.who, votes.vote_count
- FROM votes, profiles
- WHERE votes.bug_id = $bug_id
- AND profiles.userid = votes.who");
+ FROM votes INNER JOIN profiles
+ ON profiles.userid = votes.who
+ WHERE votes.bug_id = $bug_id");
while (MoreSQLData()) {
my ($name, $userid, $count) = (FetchSQLData());
@@ -170,10 +170,10 @@ sub show_user {
SendSQL("SELECT votes.bug_id, votes.vote_count, bugs.short_desc,
bugs.bug_status
- FROM votes, bugs, products
+ FROM votes
+ INNER JOIN bugs ON votes.bug_id = bugs.bug_id
+ INNER JOIN products ON bugs.product_id = products.id
WHERE votes.who = $who
- AND votes.bug_id = bugs.bug_id
- AND bugs.product_id = products.id
AND products.name = " . SqlQuote($product) .
"ORDER BY votes.bug_id");
@@ -280,9 +280,10 @@ sub record_votes {
# the ballot box.
if (scalar(@buglist)) {
SendSQL("SELECT bugs.bug_id, products.name, products.maxvotesperbug
- FROM bugs, products
- WHERE products.id = bugs.product_id
- AND bugs.bug_id IN (" . join(", ", @buglist) . ")");
+ FROM bugs
+ INNER JOIN products
+ ON products.id = bugs.product_id
+ WHERE bugs.bug_id IN (" . join(", ", @buglist) . ")");
my %prodcount;