From: jakubvrana Date: Tue, 8 Jan 2008 15:54:34 +0000 (+0000) Subject: Ignore length in date and time types X-Git-Tag: v3.0.0~1148 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=7d8851a8ca4fddfc51543b5959a14e7fefb381ab;p=adminer.git Ignore length in date and time types git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@365 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/editing.inc.php b/editing.inc.php index 1828244a..7987c731 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -74,7 +74,7 @@ function edit_type($key, $field, $collations) { function process_type($field, $collate = "COLLATE") { global $mysql, $enum_length, $unsigned; return " $field[type]" - . ($field["length"] ? "(" . process_length($field["length"]) . ")" : "") + . ($field["length"] && !preg_match('~^date|time$~', $field["type"]) ? "(" . process_length($field["length"]) . ")" : "") . (preg_match('~int|float|double|decimal~', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "") . (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate '" . $mysql->escape_string($field["collation"]) . "'" : "") ;