mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 08:34:20 +02:00
Avoid CONVERT() except in MySQL (bug #509)
This commit is contained in:
@@ -364,9 +364,9 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
$unique_idf = "";
|
||||
foreach ($unique_array as $key => $val) {
|
||||
if (($jush == "sql" || $jush == "pgsql") && strlen($val) > 64) {
|
||||
if (($jush == "sql" || $jush == "pgsql") && preg_match('~char|text|enum|set~', $fields[$key]["type"]) && strlen($val) > 64) {
|
||||
$key = (strpos($key, '(') ? $key : idf_escape($key)); //! columns looking like functions
|
||||
$key = "MD5(" . ($jush == 'sql' && preg_match("~^utf8_~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
|
||||
$key = "MD5(" . ($jush != 'sql' || preg_match("~^utf8~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
|
||||
$val = md5($val);
|
||||
}
|
||||
$unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
|
||||
|
Reference in New Issue
Block a user