simplenews_update_6010 function does not handle the db update correctly when updating from 6009 (trying to add the error field again).
User warning is:
Duplicate column name 'error' query: ALTER TABLE simplenews_mail_spool ADD `error` TINYINT NOT NULL DEFAULT 0 in /var/www/.../includes/database.mysql-common.inc on line 298.
Failed: ALTER TABLE {simplenews_mail_spool} ADD `error` TINYINT NOT NULL DEFAULT 0
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simplenews-db_update_error-804252.patch | 1.04 KB | sutharsan |
Comments
Comment #1
jfhovinne commentedConfirmed.
Tried to update from 1.0 to 1.2 with Drush and got the following:
The following updates are pending:
simplenews module
6009 - Addition of error to simplenews_mail_cache to mark an email error.
6010 - Correction of field size mismatch caused by simplenews_update_6009().
6200 - description not available
Do you wish to run all pending updates? (y/n): y
ALTER TABLE {simplenews_mail_spool} ADD `error` INT NOT NULL DEFAULT [success]
0
ALTER TABLE {simplenews_mail_spool} ADD `error` TINYINT NOT NULL [error]
DEFAULT 0
Finished performing updates. [ok]
An error occurred at function : drush_core_updatedb [error]
UPDATE finished.
Comment #2
pix_ commentedthis is happening to me too.
from 1.0 to 1.2
any suggestion?
Comment #3
sutharsan commentedI did not have may day when I made this patch :( The attached patch should fix it. You need to run update.php after you have applied this patch. If you test I will make a new release.
Comment #4
sutharsan commentedComment #5
daphisto commentedyep, same problem here. Going to try the patch.
Comment #6
j0nathan commentedHi,
I updated from 1.0 to 1.2 and got the same error.
The output from update.php:
I ran update.php two more times without any error before searching and finding out this issue.
I then applied the patch #3 and run update.php again, but it said "No updates available" for simplenews module and no update were done to the DB.
I don't know if the patch changed something or not. Is there a way to know if it worked?
Comment #7
FLAIR4IT commentedHiya!
I'm a bit special; how do I apply this patch? Is simplenews broken UNTIL it's applied? Or is it just a bit smelly?
Comment #8
sutharsan commentedTo apply a patch see: http://drupal.org/patch/apply
Comment #9
jfhovinne commented@Sutharsan: thanks for the quick reply and patch.
Tested it with a backuped DB, and didn't get any error:
I'm currently testing the module itself.
Cheers.
Comment #10
j0nathan commentedHi,
So in my case (#6), I ran again update.php but this time by manually selecting the update #6011 and it gave me this output without any error:
Comment #11
esplinter commentedHi,
I also got this error when tried to upgrade.
After the error, I restored my backup database to get the same db state than before the wrong update, applied the patch and tried to run update.php again and everything worked great.
many thanks!
Comment #12
sutharsan commentedThanks for testing. I committed the patch. If you encounter this error there is no cause for alarm and it will not cause simplenews to break.
Although it is not my habit to make frequent releases, I will break this now and make a 6.x-1.3 release to prevent many people running into this confusing bug.