#34625 [Bgs->Opn]: Scrollable cursor doesn't work with MySQL

From: Date: Sat, 24 Sep 2005 21:46:35 +0000
Subject: #34625 [Bgs->Opn]: Scrollable cursor doesn't work with MySQL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85550@lists.php.net to get a copy of this message
ID: 34625 User updated by: stewey at ambitious dot ca Reported By: stewey at ambitious dot ca -Status: Bogus +Status: Open Bug Type: PDO related Operating System: Mac OS X 10.4.2 PHP Version: 5.1.0RC1 New Comment: Thanks for the info. Constant problem resolved, but the scrollable cursor problem remains. New repro code: $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select id from table", array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) ); $statement->execute(); print_r($statement->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, 1 )); print_r($statement->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, 1 )); exit; Previous Comments: ------------------------------------------------------------------------ [2005-09-24 20:34:24] sniper@php.net All of those are expected behaviour. (constants are now defined as class constants) ------------------------------------------------------------------------ [2005-09-24 20:28:10] stewey at ambitious dot ca With php5-200509241630, I'm seeing a new problem that prevents me from testing the previous problem: PHP Warning: PDOStatement::fetch() expects parameter 1 to be long, string given ... The reproduce code is the same as above. I'm also seeing the same error for calls to PDO::setAttribute. It seems there might be a problem with the PDO constants in this build. Suggestions? Next steps? ------------------------------------------------------------------------ [2005-09-24 13:36:13] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-09-24 06:35:56] stewey at ambitious dot ca Description: ------------ Preparing a statement with the PDO_ATTR_CURSOR => PDO_CURSOR_SCROLL driver option doesn't work with MySQL. Reproduce code: --------------- $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select id from table", array(PDO_ATTR_CURSOR => PDO_CURSOR_SCROLL) ); $statement->execute(); print_r($statement->fetch( PDO_FETCH_ASSOC, PDO_FETCH_ORI_ABS, 1 )); print_r($statement->fetch( PDO_FETCH_ASSOC, PDO_FETCH_ORI_ABS, 1 )); exit; Expected result: ---------------- I would expect to see the same row output twice. If this is not a support driver option, then I would expect and error or exception thrown (yes, exceptions are enabled). Actual result: -------------- Two different rows. The PDO_FETCH_ORI_ABS arguments are seemingly ignored. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34625&edit=1

« previous php.bugs (#85550) next »