summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-12-14 10:40:22 +0100
committerjocuri%softhome.net <>2004-12-14 10:40:22 +0100
commitae5e2f0d1b041828593505cc8aa93aee53665975 (patch)
tree2deb6b0b9594930ca841adc54cea1c3a44a535ab /checksetup.pl
parent61cad277af23c2ab75f82f8d47f7f886cf3d8090 (diff)
downloadbugzilla-ae5e2f0d1b041828593505cc8aa93aee53665975.tar.gz
bugzilla-ae5e2f0d1b041828593505cc8aa93aee53665975.tar.xz
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 <mkanat@kerio.com>, r=vladd, a=justdave.
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 681d9bde3..35e7f2d39 100755
--- a/checksetup.pl
+++ b/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)");