]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Recognize ON UPDATE current_timestamp() (bug #632)
authorJakub Vrana <jakub@vrana.cz>
Wed, 19 Sep 2018 08:08:41 +0000 (10:08 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Sep 2018 08:08:41 +0000 (10:08 +0200)
adminer/include/editing.inc.php
changes.txt

index 405efdb5976c62f5ff844df8c32b50a6ca8fd810..33a52d53a2f6e6148245fda563b5006fbc61efa7 100644 (file)
@@ -157,7 +157,7 @@ echo optionlist(array_merge($extra_types, $structured_types), $type);
 <td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); //! type="number" with enabled JavaScript ?> aria-labelledby="label-length"><?php echo script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});", ""); ?><td class="options"><?php
        echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
        echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
-       echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : '');
+       echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), (preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"]) ? "CURRENT_TIMESTAMP" : $field["on_update"])) . '</select>' : '');
        echo ($foreign_keys ? "<select name='" . h($key) . "[on_delete]'" . (preg_match("~`~", $type) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist(explode("|", $on_actions), $field["on_delete"]) . "</select> " : " "); // space for IE
 }
 
index 306752cd9e4f45f41a0db925ebc3ce3e4e3b215f..d19c85f9628e2b3c19d5283a4e68b683c6c1d605 100644 (file)
@@ -6,6 +6,7 @@ Fix function change with set data type
 Increase username maxlength to 80 (bug #623)
 Make maxlength in all fields a soft limit
 MySQL: Support foreign keys created with ANSI quotes (bug #620)
+MySQL: Recognize ON UPDATE current_timestamp() (bug #632)
 PostgreSQL: Quote array values in export (bug #621)
 MSSQL: Pass database when connecting
 ClickHouse: Connect, databases list, tables list, select, SQL command