From 427d238b1a9d03d2da9f561f3abc3b14eb95bf59 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" <> Date: Fri, 14 Jan 2005 02:03:46 +0000 Subject: Bug 278148: checksetup.pl *still* errors when trying to drop index on milestones table Patch by Max K-A r=travis a=justdave --- checksetup.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'checksetup.pl') diff --git a/checksetup.pl b/checksetup.pl index f4835bb26..865c22a43 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; } -- cgit v1.2.3-24-g4f1b