php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48188 Cannot execute a scrollable cursor twice with PDO_PGSQL
Submitted: 2009-05-08 08:52 UTC Modified: 2009-05-12 22:19 UTC
From: [email protected] Assigned: mbeccati (profile)
Status: Closed Package: PDO related
PHP Version: 5.3CVS-2009-05-08 (CVS) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: [email protected]
New email:
PHP Version: OS:

 

 [2009-05-08 08:52 UTC] [email protected]
Description:
------------
Scrollable cursor support for PDO_PGSQL was introduced in PHP 5.3 (see bug #44861). Some small issues need to be ironed out, e.g. I found out that it's impossible to execute a pdo statement using a cursor twice. The current code fails as the cursor is already existing.

Reproduce code:
---------------
$pdo = new PDO("pgsql:dbname=test", 'user', 'pass', array(
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
));

$res = $pdo->prepare("SELECT (?)::int AS x", array(
        PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL
));
try {
        var_dump($res->execute(array(1)));
        var_dump($res->execute(array(2)));
}  catch (Exception $e) {
        var_dump($e->getMessage());
}


Expected result:
----------------
bool(true)
bool(true)

Actual result:
--------------
bool(true)
string(94) "SQLSTATE[42P03]: Duplicate cursor: 7 ERROR:  cursor "pdo_crsr_000000000104fee8" already exists"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-12 22:19 UTC] [email protected]
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 10:01:34 2025 UTC