Ignore length in date and time types

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@365 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-01-08 15:54:34 +00:00
parent b76fd38c16
commit 7d8851a8ca

View file

@ -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"]) . "'" : "")
;