ID:               48539
 Comment by:       tilo at levante dot de
 Reported By:      frase at cs dot wisc dot edu
 Status:           Open
 Bug Type:         PDO related
 Operating System: *
 PHP Version:      5.2.10, 5.3.0RC4
 New Comment:

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.000000000
+0100
+++ ext/pdo_dblib/dblib_driver.c        2009-06-28 01:50:50.000000000 +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;


Previous Comments:
------------------------------------------------------------------------

[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.

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

[2009-06-19 16:58:52] thomas dot parrott at jellyfish dot co dot uk

This issue appears to be in 5.2.10 as well.

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

[2009-06-19 13:40:03] frase at cs dot wisc dot edu

This problem remains in RC4.

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

[2009-06-12 19:59:51] frase at cs dot wisc dot edu

Description:
------------
I have compiled PHP 5.3.0RC3 from source as a module for Apache 2.2.11,
and I cannot open a connection to an MSSQL server using PDO's dblib
(FreeTDS) driver.  Instead, I get a PDOException with no SQLSTATE code
or message.

The sample code below works in PHP 5.2.6 (as packaged for Jaunty).

Non-PDO MSSQL connections work ("mssql_connect()").

PDO MySQL connections also work ("PDO('mysql:...')").

"phpinfo()" confirms that the PDO extension is loaded, with dblib and
mysql drivers.  The pdo_dblib section confirms that it is using
FreeTDS.

There is no change by compiling the extensions (mssql, pdo, pdo_dblib)
as external shared modules or built-in to libphp5.so.


Reproduce code:
---------------
<?php
header('Content-type: text/plain');

try {
        $db = new PDO('dblib:host=myhost;dbname=mydb', 'myuser', 'mypass') or
die("failed to connect");
        $result = $db->query('select count(1) from mytable') or die ("failed
to query database");
        echo "got ".($result->fetchColumn())." rows\n";
        $result->closeCursor() or die("failed to free resultset");
        $db = null;
} catch (Exception $e) {
        echo $e;
}


Expected result:
----------------
got (some-number) rows

Actual result:
--------------
exception 'PDOException' with message 'SQLSTATE[] (null) (severity 0)'
in /home/user/htdocs/test-pdo.php:5
Stack trace:
#0 /home/user/htdocs/test-pdo.php(5):
PDO->__construct('dblib:host=myho...', 'myuser', 'mypass')
#1 {main}


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


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

Reply via email to