summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authorterry%netscape.com <>1999-03-04 07:55:36 +0100
committerterry%netscape.com <>1999-03-04 07:55:36 +0100
commitf30e61a2918ce3374f556960dc1c13b8acf81d98 (patch)
tree62f5455f4949cd537a6f57ec251593957793e30c /sanitycheck.cgi
parentcaae0bdea91683b3c8f3435c2c594287f13c45a3 (diff)
downloadbugzilla-f30e61a2918ce3374f556960dc1c13b8acf81d98.tar.gz
bugzilla-f30e61a2918ce3374f556960dc1c13b8acf81d98.tar.xz
Added a "component/product" sanity check.
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi22
1 files changed, 20 insertions, 2 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 814a1f031..beb564958 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -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()) {