From: Jakub Vrana Date: Fri, 25 Feb 2011 09:49:19 +0000 (+0100) Subject: Respect default collation (bug #3191489) X-Git-Tag: v3.2.1~75 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=32f2000034e61f485b919b42ba1dc15b62de8a7f;p=adminer.git Respect default collation (bug #3191489) --- diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index c8f6e994..dbd17c99 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -307,7 +307,7 @@ if (!defined("DRIVER")) { $return = $match[1]; } elseif (preg_match('~ CHARACTER SET ([^ ]+)~', $create, $match)) { // default collation - $return = $collations[$match[1]][0]; + $return = $collations[$match[1]][-1]; } return $return; } @@ -479,11 +479,15 @@ if (!defined("DRIVER")) { function collations() { $return = array(); foreach (get_rows("SHOW COLLATION") as $row) { - $return[$row["Charset"]][] = $row["Collation"]; + if ($row["Default"]) { + $return[$row["Charset"]][-1] = $row["Collation"]; + } else { + $return[$row["Charset"]][] = $row["Collation"]; + } } ksort($return); foreach ($return as $key => $val) { - sort($return[$key]); + asort($return[$key]); } return $return; }