Permalink
Browse files

Use now function instead of CURRENT_TIMESTAMP

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@996 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent a8bf261 commit 2959a052c46a2b9684327189adc827c615e4a996 jakubvrana committed Aug 21, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −0 adminer/edit.inc.php
  2. +0 −2 adminer/include/adminer.inc.php
  3. +0 −2 editor/include/adminer.inc.php
@@ -78,6 +78,10 @@
$value = $adminer->editVal($value, $field);
}
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
+ if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") {
+ $value = "";
+ $function = "now";
+ }
input($field, $value, $function);
echo "\n";
}
@@ -400,8 +400,6 @@ function processInput($field, $value, $function = "") {
$return = "$function(" . idf_escape($name) . ", $return)";
} elseif (ereg('^(md5|sha1|password)$', $function)) {
$return = "$function($return)";
- } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
- $return = $value;
}
return $return;
}
@@ -331,8 +331,6 @@ function processInput($field, $value, $function = "") {
);
if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) {
$return = "NULL";
- } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
- $return = $value;
}
return $return;
}

0 comments on commit 2959a05

Please sign in to comment.