]> git.joonet.de Git - adminer.git/commitdiff
Support function default values in insert (bug #713)
authorJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 16:52:10 +0000 (17:52 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 16:52:10 +0000 (17:52 +0100)
adminer/include/functions.inc.php
changes.txt

index c581842589a1ed0810c8e01dec132967a954214b..476cf5ccf22fcb219a17458485ae4ecd0b20c50e 100644 (file)
@@ -1461,6 +1461,9 @@ function edit_form($table, $fields, $row, $update) {
                                        : ($value === false ? null : ($value !== null ? '' : 'NULL'))
                                )
                        );
+                       if (!$_POST && !$update && $value == $field["default"] && preg_match('~^[\w.]+\(~', $value)) {
+                               $function = "SQL";
+                       }
                        if (preg_match("~time~", $field["type"]) && preg_match('~^CURRENT_TIMESTAMP~i', $value)) {
                                $value = "";
                                $function = "now";
index 1e092af03c893115eb4c82641c5d78dd93ec2e06..2ccc9e6ce953b02cc735de9670424b617a33c26f 100644 (file)
@@ -1,4 +1,5 @@
 Adminer 4.7.10-dev:
+Support function default values in insert (bug #713)
 Allow SQL pseudo-function in insert
 Skip date columns for non-date values in search anywhere
 Add DB version to comment in export