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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 535884-2_fix_common_syndication_upgrade.patch | 1.12 KB | alex_b |
| #1 | parser_common_syndication.install.patch | 1.01 KB | gustav |
Comments
Comment #1
gustav commentedI 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.
Comment #2
alex_b commentedGood 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.
Comment #3
aron novakThe patch in #2 should be fine.
Those who accidentally ran a bogus update, they need to simply empty that table.
Comment #4
alex_b commentedRTBC then.
Comment #5
aron novakCommitted.
Comment #6
aron novak