[drupal-devel] [bug] Upgrade from 4.4 to 4.5.1 creates incorrect columns in menu table when using PostgreSQL

Dries drupal-devel at drupal.org
Wed Aug 17 19:18:38 UTC 2005


Issue status update for 
http://drupal.org/node/14928
Post a follow up: 
http://drupal.org/project/comments/add/14928

 Project:      Drupal
 Version:      4.5.5
 Component:    postgresql database
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Anonymous
 Updated by:   Dries
-Status:       patch (ready to be committed)
+Status:       patch (code needs work)

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




Dries



Previous comments:
------------------------------------------------------------------------

Thu, 30 Dec 2004 05:30:15 +0000 : Anonymous

Attachment: http://drupal.org/files/issues/updates.inc_2.patch (956 bytes)

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.




------------------------------------------------------------------------

Tue, 09 Aug 2005 02:17:33 +0000 : gordon

should be marked as patch




------------------------------------------------------------------------

Tue, 16 Aug 2005 17:40:23 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/updates.inc-4.5.diff (1 KB)

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




------------------------------------------------------------------------

Tue, 16 Aug 2005 17:44:43 +0000 : Cvbge

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







More information about the drupal-devel mailing list