Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-941

[GH-631] updated PDO_SQLSRV connection to use driverOptions in prepare-function

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of jaylinski:

      Url: https://github.com/doctrine/dbal/pull/631

      Message:

      it seems that the `PDO::prepare` `$driver_options` param was never used.
      in order to use the `PDOStatement::rowCount` function, the connection to an sql-server has to be established with the following params:
      ```
      $connectionParams = array(
      'host' => $cfgHostName,
      'port' => $cfgPort,
      'dbname' => $cfgDatabase,
      'user' => $cfgUser,
      'password' => $cfgPassword,
      'driver' => 'pdo_sqlsrv',
      'driverOptions' => array(
      PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL,
      PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE => PDO::SQLSRV_CURSOR_STATIC
      )
      );
      ```
      the `driverOptions`-array is essential.
      see http://msdn.microsoft.com/en-us/library/ff628176.aspx and http://at2.php.net/manual/de/pdo.prepare.php

      with the follwing commit, the driver options are used by the PDO_SQLSRV prepared statements.
      maybe there's a better way to implement this. please share your opinion on this fix.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: