1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-14 10:34:01 +02:00

Speedup of simple alter table

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1078 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-09-09 19:47:15 +00:00
parent bbd3a3c014
commit 2e680bc9bd
3 changed files with 40 additions and 22 deletions

View File

@@ -43,6 +43,15 @@ function process_type($field, $collate = "COLLATE") {
;
}
function process_field($field, $type_field) {
global $dbh;
return idf_escape($field["field"]) . process_type($type_field)
. ($field["null"] ? " NULL" : " NOT NULL") // NULL for timestamp
. (!$field["has_default"] || $field["auto_increment"] || ereg('text|blob', $field["type"]) ? "" : " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP( on update CURRENT_TIMESTAMP)?$", $field["default"]) ? $field["default"] : $dbh->quote($field["default"])))
. " COMMENT " . $dbh->quote($field["comment"])
;
}
function type_class($type) {
if (ereg('char|text', $type)) {
return " class='char'";