php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38842 PDO nextRowset not working on MySQL
Submitted: 2006-09-15 11:20 UTC Modified: 2008-07-03 12:39 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: stochnagara at hotmail dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2006-09-15 (snap) OS: windows xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stochnagara at hotmail dot com
New email:
PHP Version: OS:

 

 [2006-09-15 11:20 UTC] stochnagara at hotmail dot com
Description:
------------
Calling nextRowset on PDOStatement generates an error.

Reproduce code:
---------------
$pdo = new PDO ('mysql:...');
$q = $pdo->query ("CALL some_proc");
$q->nextRowset();

or for example

$pdo = new PDO ('mysql:...');
$q = $pdo->query ("SELECT 1; SELECT 2;");
$q->nextRowset();


Expected result:
----------------
No errors.

Actual result:
--------------
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HYC00]: Optional feature not implemented' in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-18 06:35 UTC] stochnagara at hotmail dot com
Sorry, this is not a feature request but a PDO related bug.
 [2006-09-18 07:35 UTC] tony2001@php.net
"Optional feature not implemented" means this functionality is not yet available. Which in turn means it's feature request.
 [2006-10-17 16:03 UTC] mike at we11er dot co dot uk
IMO this is a bug. If a stored procedure is called, it returns multiple row sets, one for each query inside it that returns results, and one for the return status.

Because all the results from a statement must be fetched before subsequent statements can be made, we NEED nextRowset to work otherwise the following error is received:

PDOStatement::nextRowset() [function.PDOStatement-nextRowset]: SQLSTATE[HYC00]: Optional feature not implemented

closeCursor() does not work when multiple rowsets are present.
 [2006-10-17 16:04 UTC] mike at we11er dot co dot uk
Err, sorry... that last error should be:

PDOStatement::execute() [function.PDOStatement-execute]: SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query
 [2006-12-04 17:45 UTC] mike at we11er dot co dot uk
Anyone?
 [2008-07-03 12:32 UTC] uw@php.net
Wait for PDO_MYSQLND and try again. Should be fixed.

Note that multi-statement contradicts the PDO idea of a "secure" driver. Enabling multi-statement by default means opening all doors for SQL injections!
 [2008-07-03 12:39 UTC] uw@php.net
Let's close this. This is a duplicate of many other reports such as:

#41997  	pdo_mysql: stored procedure call returning single rowset blocks future queries
Bug #39759  	Can't use stored procedures from PDO on Windows
PECL Bug #12794  	PDOStatement->nextRowset() doesn't work



 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 17:01:32 2024 UTC