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

gordon drupal-devel at drupal.org
Tue Aug 9 02:17:36 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.1
 Component:    postgresql database
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Anonymous
 Updated by:   gordon
-Status:       active
+Status:       patch (code needs review)

should be marked as patch




gordon



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.







More information about the drupal-devel mailing list