From 329fe129fe185d860d22e3f6aeb184e9e11f73b7 Mon Sep 17 00:00:00 2001 From: Davide Della Casa Venturelli Date: Fri, 21 Aug 2015 13:25:02 +0200 Subject: [PATCH] Fixed #9454: changed sqlsrv pdo class selection --- framework/db/Connection.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/db/Connection.php b/framework/db/Connection.php index 674a5027e4..82ca306f97 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -571,8 +571,12 @@ class Connection extends Component } elseif (($pos = strpos($this->dsn, ':')) !== false) { $driver = strtolower(substr($this->dsn, 0, $pos)); } - if (isset($driver) && ($driver === 'mssql' || $driver === 'dblib' || $driver === 'sqlsrv')) { - $pdoClass = 'yii\db\mssql\PDO'; + if (isset($driver)) { + if ($driver === 'mssql' || $driver === 'dblib') { + $pdoClass = 'yii\db\mssql\PDO'; + } else if ($driver === 'sqlsrv'){ + $pdoClass = 'yii\db\mssql\SqlsrvPDO'; + } } }