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

 ID:                 64522
 Updated by:         ssuffic...@php.net
 Reported by:        capile at tecnodz dot com
 Summary:            After first query to MSSQL (DBLIB) all the other
                     queries return null values
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Ubuntu Linux
 PHP Version:        5.4.13
 Block user comment: N
 Private report:     N

 New Comment:

The issue may be the way the cursor closer is implemented. It frees the column 
metadata but I can't find where it is reallocated for the next statement. This 
may be allocated in PDO core. I remember writing tests, but they did not call 
"$stmt->closeCursor();". Does your script work without the closeCursor()?

I have no way to test anymore since I do not have an SQL/Sybase server to 
connect to. :(


Previous Comments:
------------------------------------------------------------------------
[2013-05-28 17:19:11] mneyman at yesco dot com

Also tested on Ubuntu 12.04 with PHP 5.4.15 and it does not work

------------------------------------------------------------------------
[2013-03-26 18:44:16] capile at tecnodz dot com

Downgraded PHP on Ubuntu 12.10 to 5.3.10 and now it works. I also noticed that 
cursors are closed at each statement/query/exec.

------------------------------------------------------------------------
[2013-03-26 18:24:57] capile at tecnodz dot com

Description:
------------
After first statement/query/exec (successful or not) all the other statements 
return null as a result. There's nothing relevant in the 
PDOStatement::errorInfo().

Occurs no matter if the statement cursor was closed or not.

Tested on:
* Ubuntu 12.10 with both PHP 5.4.6 and 5.4.13 (doesn't work)
* Ubuntu 13.04 with PHP 5.4.9 (doesn't work)
* Ubuntu 12.04 with PHP 5.3.10 (works)

All the installations were made with apt-get (PHP 5.4.13 from 
http://ppa.launchpad.net/ondrej/php5/ubuntu).

All of them use the PDO version 1.0.4dev (got with `php --re pdo`)

Test script:
---------------
$pdo=new PDO('dblib:host=db;dbname=admin;charset=UTF-8',$username,$password);

$statement=$pdo->query('select 1+1 as result');
print_r($statement->fetchAll());
$statement->closeCursor();

$statement=$pdo->query('select 1+1 as result');
print_r($statement->fetchAll());



Expected result:
----------------
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)

Actual result:
--------------
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)
Array
(
)


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



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

Reply via email to