I just upgraded my installation from 4.4 to 4.5.1 and got these errors when trying to administer the image module:

pg_query(): query failed: ERROR: invalid input syntax for integer

They were all for the menu table. On investigation, i found this in database/updates.inc:

if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql("ALTER TABLE {menu} ADD description varchar(255) DEFAULT '' NOT NULL");
}
else {
$ret[] = update_sql("ALTER TABLE {menu} ADD description smallint");
$ret[] = update_sql("ALTER TABLE {menu} ALTER COLUMN description SET DEFAULT '0'");
$ret[] = update_sql("UPDATE {menu} SET description = '0'");
$ret[] = update_sql("ALTER TABLE {menu} ALTER COLUMN description SET NOT NULL");
}

WTH??? How is a smallint on other databases equivalent to varchar on mysql? Attached is a patch to fix the updates.inc file.

CommentFileSizeAuthor
#2 updates.inc-4.5.diff1 KBCvbge
updates.inc_2.patch956 bytesAnonymous (not verified)

Comments

gordon’s picture

Status: Active » Needs review

should be marked as patch

Cvbge’s picture

Version: » 4.5.5
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1 KB

True, updated patch for latest 4-5 (although now it's a bit late for 4.5...)

Cvbge’s picture

The patch also applies to 4-6 and HEAD, please apply.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Committed to DRUPAL-4-5 and DRUPAL-4-6. Patch failed against HEAD. Setting this to 'code needs work'.

Cvbge’s picture

Status: Needs work » Fixed

The bug no longer exists in HEAD because last patch removed old updates.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)