In .install code in function comment_notify_update_6004() there is small problem
1) Column notified is created with 'not null'=> TRUE
2) After creation, column is set to 1
Unfortunately, this translates into following Postgresql statements
1) Alter table add column - succeeds
2) alter table .. alter column set not null - FAIL because all values are null
3) update .. set notified=>1
So column should be created with DEFAULT 1 (and than changed to DEFAULT NULL) or upgrade code should add NOT NULL after initial value set.
Comments
Comment #1
gregglesSounds good to me. Can you provide a patch and test it?
Comment #2
Alex_Tutubalin commentedThere is another bug in module itself: INSERT without value for 'notified' field produces an error because of 'NOT NULL'
So, best solution is
1) Create notified field with default=>0
2) in comment_notify_update_6004 set all notified to 1 (already done in current code).
Comment #3
Alex_Tutubalin commentedHere is the patch for .install file.
I think, it is better than patch module itself...
Comment #4
gregglesThanks for the patch!
We also need an update function to fix sites with this bad column and there appears to be a spacing issue.
Comment #5
Alex_Tutubalin commentedMySQL adds DEFAULT 0 setting for NOT NULL columns itself (I've asked some MySQL gurus). So, my changes means nothing for MySQL sites
On PgSQL sites .install simply does not works because DEFAULT value is not set and no value passed for notified column when table is filled.
So, there is no working sites with 'bad columns'.
Comment #6
gregglesAlrighty then - fixed with some small code style cleanups along the way.