diff options
author | terry%mozilla.org <> | 2000-01-11 09:26:21 +0100 |
---|---|---|
committer | terry%mozilla.org <> | 2000-01-11 09:26:21 +0100 |
commit | 09035a1555ac79a74a3c40631701ae35dcd7f9fd (patch) | |
tree | 85402abccef2fe581b4726f68abf8bdd14c9c346 /describekeywords.cgi | |
parent | e7209209607207b3289c8e535d8e7504222352fa (diff) | |
download | bugzilla-09035a1555ac79a74a3c40631701ae35dcd7f9fd.tar.gz bugzilla-09035a1555ac79a74a3c40631701ae35dcd7f9fd.tar.xz |
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 'describekeywords.cgi')
-rwxr-xr-x | describekeywords.cgi | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/describekeywords.cgi b/describekeywords.cgi index 4da535c7c..bddf3b423 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -41,14 +41,19 @@ print qq{ }; SendSQL("SELECT 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 ($name, $description, $bugs) = FetchSQLData(); - if ($bugs) { + my ($name, $description, $bugs, $onebug) = FetchSQLData(); + if ($bugs && $onebug) { + # This 'onebug' stuff 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. my $q = url_quote($name); $bugs = qq{<A HREF="buglist.cgi?keywords=$q">$bugs</A>}; } else { |