Fully support functions in default values
This commit is contained in:
parent
d542843fdd
commit
851700516d
|
@ -198,12 +198,7 @@ function process_field($field, $type_field) {
|
||||||
idf_escape(trim($field["field"])),
|
idf_escape(trim($field["field"])),
|
||||||
process_type($type_field),
|
process_type($type_field),
|
||||||
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
|
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
|
||||||
(isset($default) ? " DEFAULT " . (
|
(isset($default) ? " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) && !preg_match('~^\\d*\\.?\\d+$~', $default) ? q($default) : $default) : ""),
|
||||||
(preg_match('~time~', $field["type"]) && preg_match('~^(now\(\)|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))
|
|
||||||
? $default : q($default)) : ""),
|
|
||||||
(preg_match('~timestamp|datetime~', $field["type"]) && $field["on_update"] ? " ON UPDATE $field[on_update]" : ""),
|
(preg_match('~timestamp|datetime~', $field["type"]) && $field["on_update"] ? " ON UPDATE $field[on_update]" : ""),
|
||||||
(support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""),
|
(support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""),
|
||||||
($field["auto_increment"] ? auto_increment() : null),
|
($field["auto_increment"] ? auto_increment() : null),
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
Adminer 4.5.1-dev:
|
Adminer 4.5.1-dev:
|
||||||
Fix counting selected rows after going back to select page
|
Fix counting selected rows after going back to select page
|
||||||
PHP <5.3 compatibility even with Elasticsearch enabled
|
PHP <5.3 compatibility even with Elasticsearch enabled
|
||||||
|
Fully support functions in default values
|
||||||
MariaDB: Support JSON since MariaDB 10.2
|
MariaDB: Support JSON since MariaDB 10.2
|
||||||
PostgreSQL: Support functions
|
PostgreSQL: Support functions
|
||||||
PostgreSQL: Allow editing views with uppercase letters (bug #467)
|
PostgreSQL: Allow editing views with uppercase letters (bug #467)
|
||||||
|
|
Loading…
Reference in a new issue