diff --git a/ChangeLog b/ChangeLog index 5c36ebeb6..930cf9b55 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-08-14 Robin Johnson + * Patch for Bug #449858 from Ignacio Vazquez-Abrams. First patch used, not second one. + 2001-08-10 Robin Johnson * BUG #448206, Support of table aliases - fixed, added expand_sql_query in lib.inc.php3 and a loop in db_readdump.php3 to apply it diff --git a/tbl_alter.php3 b/tbl_alter.php3 index 5f3870533..9c2df8d5d 100755 --- a/tbl_alter.php3 +++ b/tbl_alter.php3 @@ -28,9 +28,27 @@ if (isset($submit)) { $query = ''; } $query .= ' ' . backquote($field_orig[0]) . ' ' . backquote($field_name[0]) . ' ' . $field_type[0] . ' '; - if ($field_length[0] != '') { - $query .= '(' . $field_length[0] . ') '; - } + // Some field types shouldn't have lengths + switch (strtoupper($field_type[0])) + { + case 'DATE': + case 'DATETIME': + case 'TIME': + case 'TINYBLOB': + case 'TINYTEXT': + case 'BLOB': + case 'TEXT': + case 'MEDIUMBLOB': + case 'MEDIUMTEXT': + case 'LONGBLOB': + case 'LONGTEXT': + break; + + default: + if ($field_length[0] != '') { + $query .= '(' . $field_length[0] . ') '; + }; + }; if ($field_attribute[0] != '') { $query .= $field_attribute[0] . ' '; }