aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-01-11 08:26:21 +0000
committerterry%mozilla.org <>2000-01-11 08:26:21 +0000
commit09035a1555ac79a74a3c40631701ae35dcd7f9fd (patch)
tree85402abccef2fe581b4726f68abf8bdd14c9c346 /editkeywords.cgi
parentFixed a warning. (diff)
downloadbugzilla-09035a1555ac79a74a3c40631701ae35dcd7f9fd.tar.gz
bugzilla-09035a1555ac79a74a3c40631701ae35dcd7f9fd.tar.bz2
bugzilla-09035a1555ac79a74a3c40631701ae35dcd7f9fd.zip
Worked around bug in older versions of MySQL that caused a report of
one bug matching a keyword when there really are zero.
Diffstat (limited to 'editkeywords.cgi')
-rwxr-xr-xeditkeywords.cgi12
1 files changed, 10 insertions, 2 deletions
diff --git a/editkeywords.cgi b/editkeywords.cgi
index 03525f725..dcb72ae2e 100755
--- a/editkeywords.cgi
+++ b/editkeywords.cgi
@@ -135,14 +135,22 @@ if ($action eq "") {
</TR>
};
SendSQL("SELECT keyworddefs.id, keyworddefs.name, keyworddefs.description,
- COUNT(keywords.bug_id)
+ COUNT(keywords.bug_id), keywords.bug_id
FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid
GROUP BY keyworddefs.id
ORDER BY keyworddefs.name");
while (MoreSQLData()) {
- my ($id, $name, $description, $bugs) = FetchSQLData();
+ my ($id, $name, $description, $bugs, $onebug) = FetchSQLData();
$description ||= "<FONT COLOR=\"red\">missing</FONT>";
$bugs ||= 'none';
+ if (!$onebug) {
+ # This is silly hackery for old versions of MySQL that seem to
+ # return a count() of 1 even if there are no matching. So, we
+ # ask for an actual bug number. If it can't find any bugs that
+ # match the keyword, then we set the count to be zero, ignoring
+ # what it had responded.
+ $bugs = 'none';
+ }
print qq{
<TR>
<TH VALIGN="top"><A HREF="editkeywords.cgi?action=edit&id=$id">$name</TH>