]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 278148: checksetup.pl *still* errors when trying to drop index on milestones...
authortravis%sedsystems.ca <>
Fri, 14 Jan 2005 02:03:46 +0000 (02:03 +0000)
committertravis%sedsystems.ca <>
Fri, 14 Jan 2005 02:03:46 +0000 (02:03 +0000)
Patch by Max K-A <mkanat@kerio.com>    r=travis    a=justdave

checksetup.pl

index f4835bb26426c4ff980d0c1c55e065297af4db70..865c22a43ece37008ee316d556fdf39af0be3672 100755 (executable)
@@ -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;
 
     }