When I tried to update the database after upgrading to the latest 6.x-1.x-dev, I got the error message

user warning: Duplicate entry 'http://maths.york.ac.uk/yorkmood' for key 1 query: ALTER TABLE parser_common_syndication CHANGE url `url` VARCHAR(32) NOT NULL in C:\xampp\htdocs\trunk\includes\database.mysql-common.inc on line 520.

and in the update logs:

Failed: ALTER TABLE {parser_common_syndication} CHANGE url `url` VARCHAR(32) NOT NULL

The reason for this is that the function parser_common_syndication_update_6101() in parser_common_syndication.install contains the line

$ret[] = update_sql("UPDATE {parser_common_syndication} SET url = '%s' WHERE url = '%s'", md5($url['url']), $url['url']);

Note the %-substitution parameters. These are not supported by update_sql(), see http://api.drupal.org/api/function/update_sql/6

Comments

gustav’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

I have attached the trivial patch to fix this.

However I am not sure what the best way would be to help people who have already tried to do the update but failed. Currently they would have to manually perform the update. They would have to make sure that they don't by mistake hash a url twice in case they created some feeds since the failed update.

alex_b’s picture

Good catch. I would actually argue that we should just empty the table - it's only a cache table for etag and modified. After the upgrade all feeds will have to repopulate from the web.

aron novak’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #2 should be fine.
Those who accidentally ran a bogus update, they need to simply empty that table.

alex_b’s picture

RTBC then.

aron novak’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

aron novak’s picture

Status: Fixed » Closed (fixed)