From c0c21d4d121c9545f2224f7b61ce0dcb002e2fb2 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 8 Jun 2011 12:48:39 +0200 Subject: [PATCH] Preserve original timestamp value in multiple update (bug #3312614) --- adminer/edit.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- changes.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 610c308b..76754908 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -78,7 +78,7 @@ if ($fields) { if (!$_POST["save"] && is_string($value)) { $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')))); + $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL')))); if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") { $value = ""; $function = "now"; diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 1c6f3d80..1a3edbd8 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -722,7 +722,7 @@ function process_input($field) { return null; } if ($function == "orig") { - return false; + return ($field["on_update"] == "CURRENT_TIMESTAMP" ? idf_escape($field["field"]) : false); } if ($function == "NULL") { return "NULL"; diff --git a/changes.txt b/changes.txt index 2a044360..a5623b2b 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer 3.3.0-dev: Use Esc to disable in-place edit Shortcut for database privileges Append new index with auto index selection (bug #3282127) +Preserve original timestamp value in multiple update (bug #3312614) Bit type default value Display foreign key name in tooltip Display default column value in table overview