From 69f8ad52f804a6daf3d3864a500149b8455d1cd6 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sun, 20 Sep 2009 07:57:15 +0000 Subject: [PATCH] Detect unchanged timestamp git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1120 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/editing.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index a75afa98..77c9dffc 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -122,9 +122,10 @@ function process_type($field, $collate = "COLLATE") { function process_field($field, $type_field) { global $dbh; + $default = $field["default"] . ($field["on_update"] ? " ON UPDATE $field[on_update]" : ""); 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"]))) + . (!isset($field["default"]) || $field["auto_increment"] || ereg('text|blob', $field["type"]) ? "" : " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP( on update CURRENT_TIMESTAMP)?$", $default) ? $default : $dbh->quote($default))) . " COMMENT " . $dbh->quote($field["comment"]) ; }