]> git.joonet.de Git - adminer.git/commitdiff
Support current_timestamp() as default of time fields (bug #572)
authorJakub Vrana <jakub@vrana.cz>
Tue, 23 Jan 2018 07:36:11 +0000 (08:36 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 23 Jan 2018 07:36:11 +0000 (08:36 +0100)
adminer/include/editing.inc.php
changes.txt

index ec77389b8c7dfe8e7c9f38e355050b90120ccf84..e525a540cf4fc1550fea948fc29b9d56e6ac8bc3 100644 (file)
@@ -198,7 +198,7 @@ function process_field($field, $type_field) {
                process_type($type_field),
                ($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
                (isset($default) ? " DEFAULT " . (
-                       (preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP$~i', $default))
+                       (preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP(\(\))?$~i', $default))
                        || ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default))
                        || ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default))
                        || ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default))
index 05b65f1c91ebad01c0009e4a770f171383030e3e..59b1319f9002b39d46a16c2590401f37566f531d 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 4.4.1-dev:
 Display newlines in column comments (bug #573)
+Support current_timestamp() as default of time fields (bug #572)
 Adminer: Fix Search data in tables (regression from 4.4.0)
 CSP: Allow any styles, images, media and fonts, disallow base-uri
 MySQL: Support geometry in MySQL 8 (bug #574)