php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57982 PDOStatement->nextRowset() doesn't work
Submitted: 2007-12-29 18:00 UTC Modified: 2013-02-18 00:35 UTC
From: lunter at interia dot pl Assigned:
Status: No Feedback Package: PDO (PECL)
PHP Version: 5_2 CVS-2007-12-29 OS: WinXP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-12-29 18:00 UTC] lunter at interia dot pl
Description:
------------
PDOStatement->nextRowset() doesn't work


Reproduce code:
---------------
<?
 $h=new PDO('mysql:host=localhost;dbname=root','root','root');

// $q=$h->query('CALL some_proc()');
 $q=$h->query('SELECT 1 AS col;SELECT 2 AS col;');

 $r=$q->fetchAll(PDO::FETCH_ASSOC);
 print_r($r);

 $q->nextRowset();
 $r=$q->fetchAll(PDO::FETCH_ASSOC);
 print_r($r);
?>


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


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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-30 07:42 UTC] lunter at interia dot pl
This is rather important bug, becouse it doesn't permite to full use stored procedures by MySQL, MS SQL etc. programmers.
 [2008-07-03 08:04 UTC] uwendel at mysql dot com
Multi statement is a different feature than fetching results from a stored procedure! 

Multi statement contradicts the idea of PDO to take measures against SQL injections. Don't use multi statements unless you have a good reason for it. Unfortunately PDO does enable multi statements by default! Its strange to see PDO insist on Prepared Statements for "security reasons" but opening up all SQL injection doors by enabling multi statements by default.

Note that the MySQL server does not support multi statements with native prepared statements (= when turning off PDOs buggy prepared statement emulation).

Issue is fixed in PDO_MYSQLND. Please wait for PDO_MYSQLND.
 [2008-07-22 10:42 UTC] uwendel at mysql dot com
Please try again using PHP 5.3+ . You can download PHP 5.3+ from snaps.php.net.

Make sure that you try this with PHP 5.3+ and mysqlnd (--with-pdo-mysql=mysqlnd , default). It might not work when using the mysqlclient library (libmysql, --with-pdo-mysql=/path/to/mysql_config)
 [2012-03-15 02:55 UTC] kxscjjunzn at whedtt dot com
cxlmbcvht, <a href="http://www.elkzutyeml.com">mrlssfvevf</a> , [url=http://www.stupavxhbl.com]bburouynkr[/url], http://www.nwgpbbpbee.com mrlssfvevf
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC