Update database errors

Flying Drupalist - June 25, 2009 - 20:13
Project:Custom filter
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:6.x-1.0-beta2
Description

Hi, when I tried to run update.php to the latest stable, I got these errors:

* Failed: ALTER TABLE {customfilter_filters} DROP PRIMARY KEY
* Failed: ALTER TABLE {customfilter_filters} CHANGE fid `fid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid)
* Failed: ALTER TABLE {customfilter_rules} CHANGE rid `rid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid)

* user warning: Multiple primary key defined query: ALTER TABLE prefix_customfilter_filters CHANGE fid `fid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid) in /ebs1/www/includes/database.mysql-common.inc on line 520.
* user warning: Multiple primary key defined query: ALTER TABLE prefix_customfilter_rules CHANGE rid `rid` INT unsigned NOT NULL DEFAULT 1, ADD PRIMARY KEY (fid) in /ebs1/www/includes/database.mysql-common.inc on line 520.

What can I do?

Thanks!

#1

kiamlaluno - June 25, 2009 - 20:36
Title:Upgrade Error» Update database errors
Category:support request» bug report

Until I cannot state differently, I will take the code has a bug.

I will investigate on this.

#2

kiamlaluno - June 25, 2009 - 21:00

The error seems caused by the fact the database engine doesn't allow to remove the primary key, when it is a serial field; as the first query fails to remove the primary key, also the second query (which adds a primary key that is already present) fails.

#3

kiamlaluno - June 25, 2009 - 23:31
Version:6.x-1.0-beta2» 6.x-1.x-dev
Status:active» fixed

The update function has been changed, and now it executes the following steps:

  • Create a temporary table.
  • Copy the data from the old table to the temporary table.
  • Drop the old table, and rename the temporary table.

The code has been changed for the development snapshot, which will be used for the beta3 version I will make 4 days from now. You can install the development snapshot, or wait for the beta3.

Thanks for your report.

#4

Flying Drupalist - June 26, 2009 - 01:21

Thanks a lot. :)

Will it be ok to just overwrite the current beta with the new dev and then run update.php?

#5

kiamlaluno - June 26, 2009 - 01:35

Yes, it will be. Development snapshots are compatible with the official releases, and I will always offer an update path from development snapshot to development snapshot, or from development snapshot to official release.

#6

kiamlaluno - July 5, 2009 - 01:23

#7

kiamlaluno - July 5, 2009 - 01:24
Issue tags:-beta2+6.x-1.x-beta2

#8

kiamlaluno - July 5, 2009 - 01:25

#9

System Message - July 19, 2009 - 01:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.