From 0b172b595d9908ef9606c7ca59487181364595cc Mon Sep 17 00:00:00 2001 From: "jocuri%softhome.net" Date: Tue, 14 Dec 2004 01:40:22 +0000 Subject: [PATCH] Patch for bug 244756: checksetup.pl shouldn't fail to remove product index from milestones table in upgrade from 2.14.x; patch by Max K-A , r=vladd, a=justdave. --- webtools/bugzilla/checksetup.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webtools/bugzilla/checksetup.pl b/webtools/bugzilla/checksetup.pl index 681d9bde3a54..35e7f2d39945 100755 --- a/webtools/bugzilla/checksetup.pl +++ b/webtools/bugzilla/checksetup.pl @@ -3443,6 +3443,15 @@ if (GetFieldDef("products", "product")) { } print "Fixing Indexes and Uniqueness.\n"; $dbh->do("ALTER TABLE milestones DROP INDEX product"); + + # mkanat@kerio.com - bug 244756 + # Silently drop the PRIMARY key if a buggy mysqldump has put it there. + # Don't print any error messages if the index isn't there. + my $originalprintwarn = $dbh->{'PrintWarn'}; + $dbh->{'PrintWarn'} = 0; + $dbh->do("ALTER TABLE milestones DROP INDEX PRIMARY"); + $dbh->{'PrintWarn'} = $originalprintwarn; + $dbh->do("ALTER TABLE milestones ADD UNIQUE (product_id, value)"); $dbh->do("ALTER TABLE bugs DROP INDEX product"); $dbh->do("ALTER TABLE bugs ADD INDEX (product_id)");