]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fixed bug 3365 -- was generating wrong statistics if there were no NEW
authorterry%netscape.com <>
Sat, 6 Mar 1999 04:05:53 +0000 (04:05 +0000)
committerterry%netscape.com <>
Sat, 6 Mar 1999 04:05:53 +0000 (04:05 +0000)
or no ASSIGNED bugs.

collectstats.pl

index 6c51d1afc4c28f14135438035c7628a7fb172465..e35c7aa239749a865504b7ed2e3e0995c13a3595 100755 (executable)
@@ -52,21 +52,17 @@ sub collect_stats {
     my $product = shift;
     my $when = localtime (time);
 
-    my $query = "select count(bug_status) from bugs where (bug_status='NEW' or  bug_status='ASSIGNED' or bug_status='REOPENED') and product='$product' group by bug_status";
 
     $product =~ s/\//-/gs;
     my $file = join '/', $dir, $product;
     my $exists = -f $file;
 
     if (open DATA, ">>$file") {
-        SendSQL ($query);
-
-        my %count;
         push my @row, &today;
 
-        while (my @n = FetchSQLData())
-        {
-            push @row, @n;
+        foreach my $status ('NEW', 'ASSIGNED', 'REOPENED') {
+            SendSQL("select count(bug_status) from bugs where bug_status='$status' and product='$product'");
+            push @row, FetchOneColumn();
         }
 
         if (! $exists)