Skip to content

Commit

Permalink
MySQL: Unsupport hex function
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Sep 9, 2012
1 parent aff4d7d commit 31a608e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adminer/drivers/mysql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,12 +970,12 @@ function support($feature) {
}
$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" => "+/-",
Expand Down
2 changes: 1 addition & 1 deletion adminer/include/adminer.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function processInput($field, $value, $function = "") {
$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"])) {
Expand Down
2 changes: 1 addition & 1 deletion adminer/select.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$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()) {
Expand Down

0 comments on commit 31a608e

Please sign in to comment.