]> git.joonet.de Git - adminer.git/commitdiff
Preserve original timestamp value in multiple update (bug #3312614)
authorJakub Vrana <jakub@vrana.cz>
Wed, 8 Jun 2011 10:48:39 +0000 (12:48 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 8 Jun 2011 10:48:39 +0000 (12:48 +0200)
adminer/edit.inc.php
adminer/include/functions.inc.php
changes.txt

index 610c308b4ddf766f748cf59eb479aed414c8e394..76754908205bfff4d2c34ce323d829fd2093f236 100644 (file)
@@ -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";
index 1c6f3d805d75d01049cff777adb29145fc796cd2..1a3edbd86a0c258771f11389eb78f6ebffa4fa57 100644 (file)
@@ -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";
index 2a0443602138de4f543a774c3cb52c2b369c7316..a5623b2bf5661001b15b07ba467c99a7a6448d85 100644 (file)
@@ -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