From fc97a0f6cf7062d9ef9eff3197a57bec7dd7b021 Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" Date: Fri, 5 Mar 1999 17:55:45 +0000 Subject: [PATCH] Add check to make sure versions table is OK. --- webtools/bugzilla/sanitycheck.cgi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/webtools/bugzilla/sanitycheck.cgi b/webtools/bugzilla/sanitycheck.cgi index beb564958bce..db9c092eb677 100755 --- a/webtools/bugzilla/sanitycheck.cgi +++ b/webtools/bugzilla/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;