diff options
-rwxr-xr-x | checksetup.pl | 11 |
1 files changed, 8 insertions, 3 deletions
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; } |