summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/collectstats.pl b/collectstats.pl
index 4e69ab9b5..a47e2174d 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -67,6 +67,9 @@ sub collect_stats {
my $dir = shift;
my $product = shift;
my $when = localtime (time);
+ my $product_id = get_product_id($product) unless $product eq '-All-';
+
+ die "Unknown product $product" unless ($product_id or $product eq '-All-');
# NB: Need to mangle the product for the filename, but use the real
# product name in the query
@@ -82,7 +85,7 @@ sub collect_stats {
if( $product eq "-All-" ) {
SendSQL("select count(bug_status) from bugs where bug_status='$status'");
} else {
- SendSQL("select count(bug_status) from bugs where bug_status='$status' and product='$product'");
+ SendSQL("select count(bug_status) from bugs where bug_status='$status' and product_id=$product_id");
}
push @row, FetchOneColumn();
@@ -92,7 +95,7 @@ sub collect_stats {
if( $product eq "-All-" ) {
SendSQL("select count(resolution) from bugs where resolution='$resolution'");
} else {
- SendSQL("select count(resolution) from bugs where resolution='$resolution' and product='$product'");
+ SendSQL("select count(resolution) from bugs where resolution='$resolution' and product_id=$product_id");
}
push @row, FetchOneColumn();