mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Adding version check to getCharsetName() for MySQL Datasource.
This commit is contained in:
parent
aa97daeea9
commit
a91108a81a
1 changed files with 5 additions and 4 deletions
|
@ -456,13 +456,14 @@ class DboMysqlBase extends DboSource {
|
||||||
* @return string Character set name
|
* @return string Character set name
|
||||||
*/
|
*/
|
||||||
function getCharsetName($name) {
|
function getCharsetName($name) {
|
||||||
$cols = $this->query('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME= ' . $this->value($name) . ';');
|
if ((bool)version_compare(mysql_get_server_info($this->connection), "5", ">=")) {
|
||||||
if (isset($cols[0]['COLLATIONS']['CHARACTER_SET_NAME'])) {
|
$cols = $this->query('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME= ' . $this->value($name) . ';');
|
||||||
return $cols[0]['COLLATIONS']['CHARACTER_SET_NAME'];
|
if (isset($cols[0]['COLLATIONS']['CHARACTER_SET_NAME'])) {
|
||||||
|
return $cols[0]['COLLATIONS']['CHARACTER_SET_NAME'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue