From: mbecc...@php.net Operating system: * PHP version: 5.3CVS-2009-05-08 (CVS) PHP Bug Type: PDO related Bug description: Cannot execute a scrollable cursors twice with PDO_PGSQL
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" -- Edit bug report at http://bugs.php.net/?id=48188&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48188&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48188&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48188&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48188&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48188&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48188&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48188&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48188&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48188&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48188&r=support Expected behavior: http://bugs.php.net/fix.php?id=48188&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48188&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48188&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48188&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48188&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48188&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48188&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48188&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48188&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48188&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48188&r=mysqlcfg