#44861 [Opn->Ver]: scrollable cursor don't work with pgsql

From: Date: Sat, 11 Oct 2008 02:58:41 +0000
Subject: #44861 [Opn->Ver]: scrollable cursor don't work with pgsql
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129617@lists.php.net to get a copy of this message
 ID:               44861
 Updated by:       felipe@php.net
 Reported By:      php at benjaminschulz dot com
-Status:           Open
+Status:           Verified
 Bug Type:         PDO related
 Operating System: osx
 PHP Version:      5.3CVS-2008-04-29 (CVS)


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

[2008-04-29 16:13:24] php at benjaminschulz dot com

Description:
------------
I don't see how to use scrollable cursors with pdo_pgsql

Reproduce code:
---------------
$db = new Pdo("pgsql:...");
$db->setAttribute(Pdo::ATTR_ERRMODE, Pdo::ERRMODE_EXCEPTION);
$res = $db->prepare("SELECT 'row1' UNION SELECT 'row2' UNION SELECT
'row3' UNION SELECT 'row4'", array(PDO::ATTR_CURSOR =>
PDO::CURSOR_SCROLL));
$res->execute();
var_dump($res->fetch());
// $res->fetch(Pdo::FETCH_NUM, PDO::FETCH_ORI_ABS, 2) won't throw an
exception but return false

Expected result:
----------------
array('row1')

Actual result:
--------------
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[34000]: Invalid cursor name: 7 ERROR: cursor
"pdo_pgsql_cursor_00d78a0c" does not exist' in ...


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


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



Thread (6 messages)

« previous php.bugs (#129617) next »