]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 244756: checksetup.pl shouldn't fail to remove product index from miles...
authorjocuri%softhome.net <>
Tue, 14 Dec 2004 09:41:35 +0000 (09:41 +0000)
committerjocuri%softhome.net <>
Tue, 14 Dec 2004 09:41:35 +0000 (09:41 +0000)
checksetup.pl

index 1eaf0618f0a05e59bd2d250d3041b95889085de8..8e09bdfe569c8ddf10a3546fdf4ca56eec4afb5a 100755 (executable)
@@ -3336,6 +3336,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)");