From: terry%netscape.com <> Date: Sat, 6 Mar 1999 01:55:45 +0000 (+0000) Subject: Add check to make sure versions table is OK. X-Git-Tag: bugzilla-2.4~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e164c7a5857c48f97daa7d1ab21fb41463640a67;p=thirdparty%2Fbugzilla.git Add check to make sure versions table is OK. --- diff --git a/sanitycheck.cgi b/sanitycheck.cgi index beb564958b..db9c092eb6 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -51,10 +51,28 @@ PutHeader("Bugzilla Sanity Check"); print "OK, now running sanity checks.
\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;