From 35e8b419454626f4aaa22f8d94ed0d6f437f5b15 Mon Sep 17 00:00:00 2001 From: byron jones Date: Wed, 8 Jan 2020 22:59:14 +0800 Subject: [PATCH] Bug 1592410 - Don't count bugs twice when using `count_only`. --- Bugzilla/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = ''; -- 2.47.3