Respect default collation (bug #3191489)
This commit is contained in:
parent
f842e33bee
commit
32f2000034
|
@ -307,7 +307,7 @@ if (!defined("DRIVER")) {
|
||||||
$return = $match[1];
|
$return = $match[1];
|
||||||
} elseif (preg_match('~ CHARACTER SET ([^ ]+)~', $create, $match)) {
|
} elseif (preg_match('~ CHARACTER SET ([^ ]+)~', $create, $match)) {
|
||||||
// default collation
|
// default collation
|
||||||
$return = $collations[$match[1]][0];
|
$return = $collations[$match[1]][-1];
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
@ -479,11 +479,15 @@ if (!defined("DRIVER")) {
|
||||||
function collations() {
|
function collations() {
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach (get_rows("SHOW COLLATION") as $row) {
|
foreach (get_rows("SHOW COLLATION") as $row) {
|
||||||
|
if ($row["Default"]) {
|
||||||
|
$return[$row["Charset"]][-1] = $row["Collation"];
|
||||||
|
} else {
|
||||||
$return[$row["Charset"]][] = $row["Collation"];
|
$return[$row["Charset"]][] = $row["Collation"];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ksort($return);
|
ksort($return);
|
||||||
foreach ($return as $key => $val) {
|
foreach ($return as $key => $val) {
|
||||||
sort($return[$key]);
|
asort($return[$key]);
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue