diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 20a1558e..698c7959 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -970,12 +970,12 @@ if (!defined("DRIVER")) { } $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); ///< @var array operators used in select - $functions = array("char_length", "date", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select + $functions = array("char_length", "date", "from_unixtime", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select $edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only array( "char" => "md5/sha1/password/encrypt/uuid", //! JavaScript for disabling maxlength - "binary" => "md5/sha1/hex", + "binary" => "md5/sha1", "date|time" => "now", ), array( "int|float|double|decimal" => "+/-", diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index aa8d3b4f..ce78f857 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -543,7 +543,7 @@ username.form['auth[driver]'].onchange(); $return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return); } elseif (ereg('^(addtime|subtime|concat)$', $function)) { $return = "$function(" . idf_escape($name) . ", $return)"; - } elseif (ereg('^(md5|sha1|password|encrypt|hex)$', $function)) { + } elseif (ereg('^(md5|sha1|password|encrypt)$', $function)) { $return = "$function($return)"; } if (ereg("binary", $field["type"])) { diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 3e448941..386ee9be 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -30,7 +30,7 @@ $is_group = count($group) < count($select); $where = $adminer->selectSearchProcess($fields, $indexes); $order = $adminer->selectOrderProcess($fields, $indexes); $limit = $adminer->selectLimitProcess(); -$from = ($select ? implode(", ", $select) : "*" . ($oid ? ", $oid" : "")) . "\nFROM " . table($TABLE); +$from = ($select ? implode(", ", $select) : ($oid ? "$oid, " : "") . "*") . "\nFROM " . table($TABLE); $group_by = ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""); if ($_GET["val"] && is_ajax()) {