From: terry%netscape.com <> Date: Thu, 4 Mar 1999 06:55:36 +0000 (+0000) Subject: Added a "component/product" sanity check. X-Git-Tag: bugzilla-2.4~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f30e61a2918ce3374f556960dc1c13b8acf81d98;p=thirdparty%2Fbugzilla.git Added a "component/product" sanity check. --- diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 814a1f031d..beb564958b 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -50,12 +50,30 @@ PutHeader("Bugzilla Sanity Check"); print "OK, now running sanity checks.

\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()) {