summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterry%netscape.com <>1999-03-06 02:55:45 +0100
committerterry%netscape.com <>1999-03-06 02:55:45 +0100
commite164c7a5857c48f97daa7d1ab21fb41463640a67 (patch)
tree8b7aa89a7196ca4b2b4d893770489653c797ab65
parent378bc502fa31992ecd26676a42014aa677281a82 (diff)
downloadbugzilla-e164c7a5857c48f97daa7d1ab21fb41463640a67.tar.gz
bugzilla-e164c7a5857c48f97daa7d1ab21fb41463640a67.tar.xz
Add check to make sure versions table is OK.
-rwxr-xr-xsanitycheck.cgi20
1 files changed, 19 insertions, 1 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index beb564958..db9c092eb 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -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;