diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 550f7558..96d3301a 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -402,9 +402,12 @@ username.form['auth[driver]'].onchange(); // find anywhere $cols = array(); foreach ($fields as $name => $field) { - if (is_numeric($val["val"]) || !ereg('int|float|double|decimal|bit', $field["type"])) { + $is_text = ereg('char|text|enum|set', $field["type"]); + if ((is_numeric($val["val"]) || !ereg('int|float|double|decimal|bit', $field["type"])) + && (!ereg("[\x80-\xFF]", $val["val"]) || $is_text) + ) { $name = idf_escape($name); - $cols[] = ($jush == "sql" && ereg('char|text|enum|set', $field["type"]) && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name); + $cols[] = ($jush == "sql" && $is_text && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name); } } $return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0"); diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index fb8cd35b..0b66248f 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -798,12 +798,14 @@ function search_tables() { $name = $adminer->tableName($table_status); if (isset($table_status["Engine"]) && $name != "" && (!$_POST["tables"] || in_array($table, $_POST["tables"]))) { $result = $connection->query("SELECT" . limit("1 FROM " . table($table), " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())), 1)); - if ($result->fetch_row()) { + if (!$result || $result->fetch_row()) { if (!$found) { echo "