Issues

ZF-2347: Pdo_Mssql fails when using PDO_DBLIB and a non-standard port

Description

Pdo_Mssql fails when using a non-standard port because the incorrect DSN syntax is used.

Lines 91-94:


        if (isset($dsn['port'])) {
            $dsn['host'] .= ',' . $dsn['port'];
            unset($dsn['port']);
        }

The fix here is trivial: instead of using a comma to separate the host and port, use a colon. I don't know if this will affect any of the other DSN prefixes that DBLIB supposedly provides; the version I have is compiled against FreeTDS and it only exposes 'dblib' to PHP (in PDO::getAvailableDrivers), so maybe this is the only DSN now that PDO_DBLIB is Version 1.0.

Cheers,

Comments

There is only one thing to mention:

I integrated the "," because on windows only the comma works. Colon does not work on windows systems. So we can not just simply change comma to colon.

If comma does not work on *nix systems, then we will also have to take in place that it depends on the environment.

It would seem to need to be an environment condition then, since indeed this testing was done on Linux (using FreeTDS).

Fixed with revision 7474. Works now OS independent.