summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-04-04 14:19:58 +0200
committerbbaetz%student.usyd.edu.au <>2002-04-04 14:19:58 +0200
commit99da5c1938127f39a094e84b1d7e80b84be0ea68 (patch)
tree2aa5ebedfc38523aa4de68d47984d7856b231b02 /sanitycheck.cgi
parenta34eeb2081bd7e420ebbae68cc345ed760ec1988 (diff)
downloadbugzilla-99da5c1938127f39a094e84b1d7e80b84be0ea68.tar.gz
bugzilla-99da5c1938127f39a094e84b1d7e80b84be0ea68.tar.xz
Bug 126883 - bugzilla.dtd isn't quite correct
r=gerv, justdave
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi18
1 files changed, 18 insertions, 0 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 902557bb8..80b88d5fd 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -140,6 +140,24 @@ if (exists $::FORM{'rebuildvotecache'}) {
print "OK, now running sanity checks.<P>\n";
+# This one goes first, because if this is wrong, then the below tests
+# will probably fail too
+
+# This isn't extensible. Thats OK; we're not adding any more enum fields
+Status("Checking for invalid enumeration values");
+foreach my $field (("bug_severity", "bug_status", "op_sys",
+ "priority", "rep_platform", "resolution")) {
+ # undefined enum values in mysql are an empty string which equals 0
+ SendSQL("SELECT bug_id FROM bugs WHERE $field=0 ORDER BY bug_id");
+ my @invalid;
+ while (MoreSQLData()) {
+ push (@invalid, FetchOneColumn());
+ }
+ if (@invalid) {
+ Alert("Bug(s) found with invalid $field value: ".join(', ',@invalid));
+ }
+}
+
CrossCheck("keyworddefs", "id",
["keywords", "keywordid"]);