Zend Framework

PDO_Mssql DSN includes _config['options']

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.9.2
  • Component/s: Zend_Db
  • Labels:
    None

Description

Zend_Db_Adapter_Pdo_Mssql::_dsn() is including $this->_config['options'] in the DSN. Example:

$db = new Zend_Config(array(
    'adapter'  => 'PDO_Mssql',
    'params'   => array(
        'host'     => 'localhost',
        'port'     => '1433',
        'dbname'   => 'db',
        'username' => 'user',
        'password' => 'pass'
    )
));

$db = Zend_Db::factory($db);

Results in the following DSN being generated when Zend_Db_Adapter_Pdo_Mssql::_dsn() is called:
dblib:host=localhost:1433;dbname=db;options=Array

Fix is addition of the following to along with the other existing unsets() in 'Zend/Db/Adapter/Pdo/Mssql.php':

unset($dsn['username']);
unset($dsn['password']);
unset($dsn['driver_options']);
unset($dsn['options']); // Add me

This bug does not affect functionality since the addition of "options=Array" in the DSN is ignored, but I believe it is invalid none the less.

Activity

Hide
Ralph Schindler added a comment -

Fixed in r17722

Show
Ralph Schindler added a comment - Fixed in r17722
Hide
Ralph Schindler added a comment -

Fixed in release branch 1.9

Show
Ralph Schindler added a comment - Fixed in release branch 1.9

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: