From: byron jones Date: Wed, 8 Jan 2020 14:59:14 +0000 (+0800) Subject: Bug 1592410 - Don't count bugs twice when using `count_only`. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35e8b419454626f4aaa22f8d94ed0d6f437f5b15;p=thirdparty%2Fbugzilla.git Bug 1592410 - Don't count bugs twice when using `count_only`. --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index af6d9e574..7afcaf77b 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -936,7 +936,7 @@ sub _sql { # BMO allow fetching just the number of matching bugs if ($self->_params->{count_only}) { - $select = 'COUNT(*) AS count'; + $select = 'COUNT(DISTINCT bugs.bug_id) AS count'; $group_by = ''; $order_by = ''; $limit = '';