Bug #63638 [Com]: Cannot connect to SQL Server 2008 with PDO dblib

2012-12-07 Thread wdmeldon at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=63638&edit=1

 ID: 63638
 Comment by: wdmeldon at gmail 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:

I've tested this in SQL Server 2012, 2008 and 2005 with similar results.  The 
warnings do not always manifest however.  I've noticed returning output will 
prevent the warning as will calling other functions, but it's a crap shoot. 

The connection seems to be fine and the data returned is as well, so more 
annoying 
than anything else.

Running Ubuntu Server 12.04 with PHP 5.4.9.


Previous Comments:

[2012-12-05 16:49:09] f dot marquis at of2m dot fr

same problem here, but only from time to time (not all connections are failing 
like with pmeunier)

seems related to #63258


[2012-11-28 21:43:00] pmeunier at cybergeneration dot com

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.


[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


Bug #48539 [Com]: pdo_dblib fails to connect, throws empty PDOException "SQLSTATE[] (null)"

2012-12-13 Thread wdmeldon at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=48539&edit=1

 ID: 48539
 Comment by: wdmeldon at gmail dot com
 Reported by:frase at cs dot wisc dot edu
 Summary:pdo_dblib fails to connect, throws empty
 PDOException "SQLSTATE[] (null)"
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   *
 PHP Version:5.2.10, 5.3.0RC4
 Assigned To:felipe
 Block user comment: N
 Private report: N

 New Comment:

I've tested this in 5.3.19 and was not able to replicate.


Previous Comments:

[2012-07-13 13:10:20] snowcorenet at gmail dot com

Could anyone tell me, please, if this is fixed in php 5.3?


[2011-04-11 18:37:18] tom at punkave dot com

Did this fix ever get put in PHP 5.3? I am getting this error exactly as 
originally described with all PHP 5.3.x versions tried.


[2009-06-28 02:10:33] fel...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.2 and HEAD.
5.3 in soon.

Thanks.


[2009-06-27 21:43:08] tilo at levante dot de

The following patch solved the issue in version 5.2.10
These three lines were added from version 5.2.9 to 5.2.10.

I use a ms sql 7 server, maybe this server is not able th set the TEXTLIMIT to 
the given value.

Greetings

tilo


--- ext/pdo_dblib/dblib_driver.c.orig   2009-03-20 23:14:17.0 +0100
+++ ext/pdo_dblib/dblib_driver.c2009-06-28 01:50:50.0 +0200
@@ -230,9 +230,9 @@
goto cleanup;
}
 
-   if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
-   goto cleanup;
-   }
+// if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
+// goto cleanup;
+// }
 
if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
goto cleanup;


[2009-06-25 16:57:52] nicholas dot j dot miller at gmail dot com

Our development team is seeing this problem in 5.2.10 as well.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=48539


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