summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-25 07:43:28 +0100
committermkanat%kerio.com <>2005-02-25 07:43:28 +0100
commite92cc4c9b115dfae6e352660c053e142634a3ef4 (patch)
tree61ba45aba841dcf21f286a79501579d2a7d71347 /sanitycheck.cgi
parent80c0cdba14f2fe81d7803e46af91ab5e77e45266 (diff)
downloadbugzilla-e92cc4c9b115dfae6e352660c053e142634a3ef4.tar.gz
bugzilla-e92cc4c9b115dfae6e352660c053e142634a3ef4.tar.xz
Bug 17453: Enumerators in Bugzilla are not cross-DB compatible. This removes all 'enum' types in the database from Bugzilla.
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=joel, a=justdave
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi43
1 files changed, 20 insertions, 23 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 163f0f5cb..d05c65b1f 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -20,6 +20,7 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Matthew Tuck <matty@chariot.net.au>
+# Max Kanat-Alexander <mkanat@kerio.com>
use strict;
@@ -200,29 +201,6 @@ if (defined $cgi->param('rescanallBugMail')) {
print "OK, now running sanity checks.<p>\n";
###########################################################################
-# Check enumeration values
-###########################################################################
-
-# 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: ".
- BugListLinks(@invalid));
- }
-}
-
-###########################################################################
# Perform referential (cross) checks
###########################################################################
@@ -352,6 +330,25 @@ CrossCheck("products", "id",
["flaginclusions", "product_id", "type_id"],
["flagexclusions", "product_id", "type_id"]);
+# Check the former enum types -mkanat@kerio.com
+CrossCheck("bug_status", "value",
+ ["bugs", "bug_status"]);
+
+CrossCheck("resolution", "value",
+ ["bugs", "resolution"]);
+
+CrossCheck("bug_severity", "value",
+ ["bugs", "bug_severity"]);
+
+CrossCheck("op_sys", "value",
+ ["bugs", "op_sys"]);
+
+CrossCheck("priority", "value",
+ ["bugs", "priority"]);
+
+CrossCheck("rep_platform", "value",
+ ["bugs", "rep_platform"]);
+
CrossCheck('series', 'series_id',
['series_data', 'series_id']);