]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1592410 - Don't count bugs twice when using `count_only`.
authorbyron jones <byron@glob.com.au>
Wed, 8 Jan 2020 14:59:14 +0000 (22:59 +0800)
committerdklawren <dklawren@users.noreply.github.com>
Wed, 8 Jan 2020 14:59:14 +0000 (09:59 -0500)
Bugzilla/Search.pm

index af6d9e57474b0c36bd653cc1f529d3ecaba4ed37..7afcaf77bf7a1e4bfd51be6af6ccfbde3055f6e6 100644 (file)
@@ -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    = '';