From e92cc4c9b115dfae6e352660c053e142634a3ef4 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 25 Feb 2005 06:43:28 +0000 Subject: 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 r=joel, a=justdave --- sanitycheck.cgi | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) (limited to 'sanitycheck.cgi') 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 # Matthew Tuck +# Max Kanat-Alexander use strict; @@ -199,29 +200,6 @@ if (defined $cgi->param('rescanallBugMail')) { print "OK, now running sanity checks.

\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']); -- cgit v1.2.3-24-g4f1b