Specify collation as well when connecting to the database if it is provided. See #6410 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@7579 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3112a4894b
commit
4589dad387
|
@ -84,8 +84,18 @@ class wpdb {
|
|||
|
||||
$this->ready = true;
|
||||
|
||||
if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') )
|
||||
$this->query("SET NAMES '$this->charset'");
|
||||
if ( $this->supports_collation() ) {
|
||||
$collation_query = '';
|
||||
if ( !empty($this->charset) ) {
|
||||
$collation_query = "SET NAMES '{$this->charset}'";
|
||||
if (!empty($this->collate) )
|
||||
$collation_query .= " COLLATE '{$this->collate}'";
|
||||
}
|
||||
|
||||
if ( !empty($collation_query) )
|
||||
$this->query($collation_query);
|
||||
|
||||
}
|
||||
|
||||
$this->select($dbname);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue