From: travis%sedsystems.ca <> Date: Fri, 14 Jan 2005 02:03:46 +0000 (+0000) Subject: Bug 278148: checksetup.pl *still* errors when trying to drop index on milestones... X-Git-Tag: bugzilla-2.19.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=427d238b1a9d03d2da9f561f3abc3b14eb95bf59;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 f4835bb264..865c22a43e 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -2365,9 +2365,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; }