]> 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:02:19 +0000 (02:02 +0000)
committertravis%sedsystems.ca <>
Fri, 14 Jan 2005 02:02:19 +0000 (02:02 +0000)
Patch by Max K-A <mkanat@kerio.com>    r=travis    a=justdave

checksetup.pl

index 38dc06497254e45196f2d7fd208827bd9406c6e4..ec7aaa6a82b050e7795b2ff1070dcb90a449b501 100755 (executable)
@@ -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;
 
     }