]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Add check to make sure versions table is OK.
authorterry%netscape.com <>
Sat, 6 Mar 1999 01:55:45 +0000 (01:55 +0000)
committerterry%netscape.com <>
Sat, 6 Mar 1999 01:55:45 +0000 (01:55 +0000)
sanitycheck.cgi

index beb564958bce9e8bc0b354b26fbf7e2c7a6132d6..db9c092eb67706fed7ad1ff42ca9ae2ca754e537 100755 (executable)
@@ -51,10 +51,28 @@ PutHeader("Bugzilla Sanity Check");
 print "OK, now running sanity checks.<P>\n";
 
 my @row;
+my @checklist;
+
+Status("Checking version/products");
+
+SendSQL("select distinct product, version from bugs");
+while (@row = FetchSQLData()) {
+    my @copy = @row;
+    push(@checklist, \@copy);
+}
+
+foreach my $ref (@checklist) {
+    my ($product, $version) = (@$ref);
+    SendSQL("select count(*) from versions where program = '$product' and value = '$version'");
+    if (FetchOneColumn() != 1) {
+        Alert("Bug(s) found with invalid product/version: $product/$version");
+    }
+}
+
 
 Status("Checking components/products");
 
-my @checklist;
+@checklist = ();
 SendSQL("select distinct product, component from bugs");
 while (@row = FetchSQLData()) {
     my @copy = @row;