DbConnection: Fix "Driver does not support setting attributes" for the pdolib extension

fixes #2545

(cherry picked from commit f25420f45874da1fdd49bd6ed2221af8b77473c3)
Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
Eric Lippmann 2017-07-11 17:20:25 +02:00
parent b6a3604086
commit 75291386b2

View File

@ -139,7 +139,14 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
switch ($this->dbType) {
case 'mssql':
$adapter = 'Pdo_Mssql';
$adapterParamaters['pdoType'] = $this->config->get('pdoType', 'dblib');
$pdoType = $this->config->get('pdoType', 'dblib');
if ($pdoType === 'dblib') {
// Driver does not support setting attributes
unset($adapterParamaters['persistent']);
unset($adapterParamaters['options']);
unset($adapterParamaters['driver_options']);
}
$adapterParamaters['pdoType'] = $pdoType;
$defaultPort = 1433;
break;
case 'mysql':