]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Added a "component/product" sanity check.
authorterry%netscape.com <>
Thu, 4 Mar 1999 06:55:36 +0000 (06:55 +0000)
committerterry%netscape.com <>
Thu, 4 Mar 1999 06:55:36 +0000 (06:55 +0000)
sanitycheck.cgi

index 814a1f031d8456bf787365b0b03d3b964e7480a4..beb564958bce9e8bc0b354b26fbf7e2c7a6132d6 100755 (executable)
@@ -50,12 +50,30 @@ PutHeader("Bugzilla Sanity Check");
 
 print "OK, now running sanity checks.<P>\n";
 
+my @row;
+
+Status("Checking components/products");
+
+my @checklist;
+SendSQL("select distinct product, component from bugs");
+while (@row = FetchSQLData()) {
+    my @copy = @row;
+    push(@checklist, \@copy);
+}
+
+foreach my $ref (@checklist) {
+    my ($product, $component) = (@$ref);
+    SendSQL("select count(*) from components where program = '$product' and value = '$component'");
+    if (FetchOneColumn() != 1) {
+        Alert("Bug(s) found with invalid product/component: $product/$component");
+    }
+}
+
+
 Status("Checking profile ids...");
 
 SendSQL("select userid,login_name from profiles");
 
-my @row;
-
 my %profid;
 
 while (@row = FetchSQLData()) {