From: Jakub Vrana Date: Mon, 8 Feb 2021 16:52:10 +0000 (+0100) Subject: Support function default values in insert (bug #713) X-Git-Tag: v4.8.0~41 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=4f8ecd3c111a4c420bfe42df5f238dd7ef3fdd33;p=adminer.git Support function default values in insert (bug #713) --- diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index c5818425..476cf5cc 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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"; diff --git a/changes.txt b/changes.txt index 1e092af0..2ccc9e6c 100644 --- a/changes.txt +++ b/changes.txt @@ -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