image_update_5200() created the image table with the the image_size column specified as image_size VARCHAR(32) NOT NULL.

The Drupal 6 schema has an explicit default => ''

Schema module reports this as:

* image
    * column image_size - difference on: default
        declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')
        actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '32', 'not null' => TRUE)

A new image_update_61xx() to re-set this attribute would sort this out.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
720 bytes

Thanks for reporting this and investigating the problem.

Could you test this patch please?

sun’s picture

+++ image.install	29 Dec 2009 20:38:15 -0000
@@ -376,3 +376,15 @@ function image_update_6103() {
+ * Set the default for {image}.image_size, cleaning up for update 5200 above.

Ideally, this should be more explicit:

Fix default value for {image}.image_size, introduced in image_update_5200().

+++ image.install	29 Dec 2009 20:38:15 -0000
@@ -376,3 +376,15 @@ function image_update_6103() {
+ *
+ * @see <http://drupal.org/node/642052> for more details.

This can be removed.

+++ image.install	29 Dec 2009 20:38:15 -0000
@@ -376,3 +376,15 @@ function image_update_6103() {
+  $query = "ALTER TABLE {image} ALTER COLUMN image_size SET DEFAULT ''";
+  $ret[] = update_sql($query);

Can we write this on one line?

This review is powered by Dreditor.

joachim’s picture

> Can we write this on one line?

I'm following the same format as other update functions that call update_sql().

joachim’s picture

Status: Needs review » Fixed
FileSize
659 bytes

#642052 by joachim: Fixed schema mis-match introduced by image_update_5200().

Committed this patch.

Status: Fixed » Closed (fixed)

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