diff --git a/ChangeLog.md b/ChangeLog.md index 7417902b..384c6ffa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,12 @@ RDBMS support for the XP Framework: MySQL, Sybase, MSSQL, PostgreSQL, SQLite3, I ## ?.?.? / ????-??-?? +## 9.0.2 / 2016-08-29 + +* Fixed drivers selecting mysqlnd-backed mysqli extension, which leads + to *mysqlnd cannot connect to MySQL 4.1+* errors + (@thekid) + ## 9.0.1 / 2016-08-29 * Added compatibility with xp-framework/networking v8.0.0 - @thekid diff --git a/src/main/php/rdbms/DefaultDrivers.class.php b/src/main/php/rdbms/DefaultDrivers.class.php index fea7936f..daf12876 100644 --- a/src/main/php/rdbms/DefaultDrivers.class.php +++ b/src/main/php/rdbms/DefaultDrivers.class.php @@ -13,7 +13,9 @@ class DefaultDrivers extends DriverImplementationsProvider { static function __static() { // MySQL support: Use mysqli extension by default, mysql otherwise. Never use mysqlnd! - if (extension_loaded('mysqli')) { + if (extension_loaded('mysqlnd')) { + self::$impl['mysql']= ['rdbms.mysqlx.MySqlxConnection', 'rdbms.mysqli.MySQLiConnection', 'rdbms.mysql.MySQLConnection']; + } else if (extension_loaded('mysqli')) { self::$impl['mysql']= ['rdbms.mysqli.MySQLiConnection', 'rdbms.mysql.MySQLConnection', 'rdbms.mysqlx.MySqlxConnection']; } else if (extension_loaded('mysql')) { self::$impl['mysql']= ['rdbms.mysql.MySQLConnection', 'rdbms.mysqli.MySQLiConnection', 'rdbms.mysqlx.MySqlxConnection'];