Several upgrade path tests return the following error

Failed: PDOException: SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "signature_format" violates not-null constraint: UPDATE simpletest335746users SET signature_format=:db_update_placeholder_0 WHERE (signature = :db_condition_placeholder_0) AND (signature_format = :db_condition_placeholder_1) ; Array ( [target] => default [return] => 2 [already_prepared] => 1 ) in user_update_7010() (line 663 of /home/stevel/drupal/d7/modules/user/user.install).

The field should be marked NULL as per a previous update function, but the postgresql driver does not account for the change.

Comments

Stevel’s picture

StatusFileSize
new1.08 KB

Old code was left in previous patch, reroll

Stevel’s picture

Title: PostgreSQL does not support changing NOT NULL in db_change_field » Upgrade path broken on PostgreSQL: can't change NOT NULL

Reflecting the consequence of this bug

Stevel’s picture

Removed superflous newline, no other changes

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

This patch adds another missing bit to changeField() on PostgreSQL: handling of NULL / not NULL values.

I asked Stevel to check the behavior of PostgreSQL when the column is already NULL or NOT NULL, and it is a no-operation and doesn't trigger and error. Looks good to go.

dries’s picture

Status: Reviewed & tested by the community » Fixed

This looks good. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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