Edit report at https://bugs.php.net/bug.php?id=63638&edit=1

 ID:                 63638
 Comment by:         pmeunier at cybergeneration dot com
 Reported by:        pmeunier at cybergeneration dot com
 Summary:            Cannot connect to SQL Server 2008 with PDO dblib
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Linux Slackware 13
 PHP Version:        5.4.9
 Block user comment: N
 Private report:     N

 New Comment:

We made a compare between the /ext/pdo_dblib/ php 5.4.7 and php 5.4.9 and found 
only one file was changed. Line 318 in dblib_driver.c went from :

// In PHP 5.4.7
DBSETOPT(H->link, DBQUOTEDIDENT, 1);

To :

// In PHP 5.4.9
DBSETOPT(H->link, DBQUOTEDIDENT, NULL);

For fun, we tried to revert to passing 1 for the last parameter... and guess 
what ? It worked. Since we don't actually understand what this function makes, 
and why the parameter was changed, we don't find this solution very clean, 
unless it is eventually confirmed by a PHP developper.


Previous Comments:
------------------------------------------------------------------------
[2012-11-28 21:09:02] pmeunier at cybergeneration dot com

Description:
------------
We are relying on PDO_DBLIB to connect to our SQL Server 2008 Server in PHP, 
hosted on a Linux platform. We were running PHP 5.4.7 and everything was fine. 
When we upgraded to 5.4.9, all connections to SQL Server were failing with the 
following error : Warning: PDO::__construct(): Called dbsetopt with parameter 3 
NULL (severity 11). We tried with different logins to be sure that it was not a 
permission issue, but the bug also occurs when trying to log with 'sa'.

Test script:
---------------
$connection = new PDO('dblib:host=myServerHost;dbname=MyDatabase', 'username', 
'pass');

Expected result:
----------------
We expect no warnings to be thrown and connection to SQL Server to work

Actual result:
--------------
A warning is thrown : Warning: PDO::__construct(): Called dbsetopt with 
parameter 
3 NULL (severity 11)


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63638&edit=1

Reply via email to