From: travis%sedsystems.ca <> Date: Fri, 14 Jan 2005 02:02:19 +0000 (+0000) Subject: Bug 278148: checksetup.pl *still* errors when trying to drop index on milestones... X-Git-Tag: bugzilla-2.18~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02f8d4fb6a4be89050653d31c962ca8ed3dca919;p=thirdparty%2Fbugzilla.git Bug 278148: checksetup.pl *still* errors when trying to drop index on milestones table Patch by Max K-A r=travis a=justdave --- diff --git a/checksetup.pl b/checksetup.pl index 38dc064972..ec7aaa6a82 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -2232,9 +2232,14 @@ sub DropIndexes ($) # next if exists $SEEN{$$ref[2]}; - my $dropSth = $dbh->prepare("ALTER TABLE $table DROP INDEX $$ref[2]"); - $dropSth->execute; - $dropSth->finish; + if ($$ref[2] eq 'PRIMARY') { + # The syntax for dropping a PRIMARY KEY is different + # from the normal DROP INDEX syntax. + $dbh->do("ALTER TABLE $table DROP PRIMARY KEY"); + } + else { + $dbh->do("ALTER TABLE $table DROP INDEX $$ref[2]"); + } $SEEN{$$ref[2]} = 1; }