Respect field function
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@851 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
5a0d809cb9
commit
ed2c27c249
|
@ -78,7 +78,7 @@ if ($fields) {
|
||||||
? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
|
? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
|
||||||
: ($_POST["clone"] && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : $field["default"]))
|
: ($_POST["clone"] && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : $field["default"]))
|
||||||
);
|
);
|
||||||
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($field[($where ? "on_update" : "default")] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
|
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
|
||||||
input($name, $field, $value, $function);
|
input($name, $field, $value, $function);
|
||||||
if (isset($_GET["default"]) && $field["type"] == "timestamp") {
|
if (isset($_GET["default"]) && $field["type"] == "timestamp") {
|
||||||
if (!isset($create) && !$_POST) {
|
if (!isset($create) && !$_POST) {
|
||||||
|
|
|
@ -348,8 +348,6 @@ function process_input($name, $field) {
|
||||||
return false; //! report errors
|
return false; //! report errors
|
||||||
}
|
}
|
||||||
return "_binary" . $dbh->quote($file);
|
return "_binary" . $dbh->quote($file);
|
||||||
} elseif ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") {
|
|
||||||
return $value;
|
|
||||||
} elseif (ereg('^(now|uuid)$', $function)) {
|
} elseif (ereg('^(now|uuid)$', $function)) {
|
||||||
return "$function()";
|
return "$function()";
|
||||||
} elseif (ereg('^[+-]$', $function)) {
|
} elseif (ereg('^[+-]$', $function)) {
|
||||||
|
@ -360,6 +358,8 @@ function process_input($name, $field) {
|
||||||
return "$function(" . idf_escape($name) . ", " . $dbh->quote($value) . ")";
|
return "$function(" . idf_escape($name) . ", " . $dbh->quote($value) . ")";
|
||||||
} elseif (ereg('^(md5|sha1|password)$', $function)) {
|
} elseif (ereg('^(md5|sha1|password)$', $function)) {
|
||||||
return "$function(" . $dbh->quote($value) . ")";
|
return "$function(" . $dbh->quote($value) . ")";
|
||||||
|
} elseif ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") {
|
||||||
|
return $value;
|
||||||
} else {
|
} else {
|
||||||
return $dbh->quote($value);
|
return $dbh->quote($value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ Create single column foreign key in table structure
|
||||||
Separate types to groups in table creation
|
Separate types to groups in table creation
|
||||||
Show type in field name title (thanks to Jakub Sochor)
|
Show type in field name title (thanks to Jakub Sochor)
|
||||||
Preselect now() for timestamp columns (thanks to paranoiq)
|
Preselect now() for timestamp columns (thanks to paranoiq)
|
||||||
|
Clear history (thanks to paranoiq)
|
||||||
Faster multiple update, clone and delete
|
Faster multiple update, clone and delete
|
||||||
Use HTML Strict instead of XHTML
|
Use HTML Strict instead of XHTML
|
||||||
Fix grant ALL PRIVILEGES with GRANT OPTION
|
Fix grant ALL PRIVILEGES with GRANT OPTION
|
||||||
|
|
1
todo.txt
1
todo.txt
|
@ -13,6 +13,7 @@ Edit default values directly in table creation
|
||||||
Offer enum and set items in search - whisperer
|
Offer enum and set items in search - whisperer
|
||||||
Use event $intervals + microseconds in relative date functions
|
Use event $intervals + microseconds in relative date functions
|
||||||
Ability to select external style - list downloaded by JavaScript
|
Ability to select external style - list downloaded by JavaScript
|
||||||
|
Table list cache - SHOW TABLE STATUS is slow with big InnoDB tables
|
||||||
? Column and table names auto-completition in SQL textarea
|
? Column and table names auto-completition in SQL textarea
|
||||||
? Save token also to cookie - for session expiration and login in other window
|
? Save token also to cookie - for session expiration and login in other window
|
||||||
? Save uploaded files after error to session variable instead of hidden field
|
? Save uploaded files after error to session variable instead of hidden field
|
||||||
|
|
Loading…
Reference in a new issue