BGFIX: #2527 - Fix mysql version detection on hosts with custom mysql version names (HakTom)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63904 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-10-08 22:05:56 +00:00
parent 015385c526
commit bd1b9e4f73

View File

@ -69,7 +69,7 @@ class MySQLDatabase extends Database {
*/
public function getVersion() {
if(!$this->mysqlVersion) {
$this->mysqlVersion = (float)$this->query("SELECT VERSION()")->value();
$this->mysqlVersion = (float)substr(trim(ereg_replace("([A-Za-z-])", "", $this->query("SELECT VERSION()")->value())), 0, 3);
}
return $this->mysqlVersion;
}