Just tried to update to the latest 6.x version and I receive the following error in a red box:

user warning: Multiple primary key defined query: ALTER TABLE audio CHANGE vid `vid` INT unsigned NOT NULL DEFAULT 0, ADD PRIMARY KEY (vid) in /home/corydorn/public_html/corydorning/includes/database.mysql-common.inc on line 520.

at the bottom it says the following:

The following queries were executed
audio module
Update #6000

    * Failed: ALTER TABLE {audio} CHANGE vid `vid` INT unsigned NOT NULL DEFAULT 0, ADD PRIMARY KEY (vid)
    * ALTER TABLE {audio} CHANGE nid `nid` INT unsigned NOT NULL DEFAULT 0
    * ALTER TABLE {audio} CHANGE file_size `file_size` INT unsigned NOT NULL DEFAULT 0
CommentFileSizeAuthor
#4 audio-install.patch1.81 KBmfb
#3 audio-install.patch1.57 KBmfb

Comments

yngens’s picture

Same problem here:

The following queries were executed
audio module
Update #6000

* Failed: ALTER TABLE {audio} CHANGE vid `vid` INT unsigned NOT NULL DEFAULT 0, ADD PRIMARY KEY (vid)
* ALTER TABLE {audio} CHANGE nid `nid` INT unsigned NOT NULL DEFAULT 0
* ALTER TABLE {audio} CHANGE file_size `file_size` INT unsigned NOT NULL DEFAULT 0

mfb’s picture

Assigned: Unassigned » mfb

Ah neglected to call db_drop_primary_key() in the update script.

mfb’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

This patch fixes the previous update on the audio table.
It also includes an additional update, for the audio_metadata table. This one I believe I handled correctly..

mfb’s picture

StatusFileSize
new1.81 KB

Also we could reapply the previous failed update, for anyone who has been using these dev snapshots.

yngens’s picture

after applying the patch in #4 and running update.php it stuck on third step (3. Run updates) forever.

1. Overview
2. Select updates
3. Run updates
4. Review log

mfb’s picture

@yngens: interesting, I am not setting that. How many audio nodes do you have in your db? The key dropping and adding probably takes a long time on large tables.

yngens’s picture

actually, i am experimenting on a fresh install. i have only two audio files.

yngens’s picture

and i tried to update again after deleting those two files. the same result - it never passes step #3 of update process. no error in the logs.

yngens’s picture

mfb, i am sorry, but my issue was not related to your patch. just before applying the patch i happened to add to .htaccess files as the following way:

RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^(.*)$ http://ru.mysite.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://ru.mysite.com/$1 [L,R=301]

i don't know why, but that was causing update.php to loop at its step #3. after removing both rewrite rules in htaccess, update.php has run smoothly:

The following queries were executed
audio module
Update #6001

    * ALTER TABLE {audio} DROP PRIMARY KEY
    * ALTER TABLE {audio} CHANGE vid `vid` INT unsigned NOT NULL DEFAULT 0, ADD PRIMARY KEY (vid)
    * ALTER TABLE {audio_metadata} DROP PRIMARY KEY
    * ALTER TABLE {audio_metadata} CHANGE vid `vid` INT unsigned NOT NULL DEFAULT 0
    * ALTER TABLE {audio_metadata} ADD PRIMARY KEY (vid, tag, value)

thank you!

mfb’s picture

Status: Needs review » Fixed

Committed, thanks for the reports.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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