From c9da03164b6d3a50ab6de8caad893b5a88ae64f1 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Mon, 29 Aug 2016 18:07:02 +0200 Subject: [PATCH] Fix drivers selecting mysqlnd-backed mysqli extension --- ChangeLog.md | 6 ++++++ src/main/php/rdbms/DefaultDrivers.class.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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'];