Details
-
Type:
Bug
-
Status:
Postponed
-
Priority:
N/A
-
Resolution: Unresolved
-
Affects Version/s: 1.0.2
-
Fix Version/s: Next Major Release
-
Component/s: Zend_Db
-
Labels:None
Description
Patrick Calkins writes:
Code:
$pdoParams = array( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true ); $params = array( 'host' => '127.0.0.1', 'username' => 'webuser', 'password' => 'xxxxxx', 'dbname' => 'test', 'driver_options' => $pdoParams ); $db = Zend_Db::factory('Pdo_Mysql', $params); // Stored procedure returns a single row $stmt = $db->prepare('CALL get_customer_by_id(:customerId)'); $stmt->bindParam('customerId', $customerId, PDO::PARAM_INT); $stmt->execute(); $result = $stmt->fetchAll(); print_r($result); $stmt->closeCursor(); // Stored procedure returns a single row $stmt = $db->prepare('CALL get_address_by_id(:customerId)'); $stmt->bindParam('customerId', $customerId, PDO::PARAM_INT); $stmt->execute(); $result = $stmt->fetchAll(); print_r($result);This will consistently throw this error: 'SQLSTATE[HY000]: General error:
2014 Cannot execute queries while other unbuffered queries are active.
Consider using PDOStatement::fetchAll(). Alternatively, if your code is only
ever going to run against mysql, you may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.'If you insert $stmt->nextRowset(); before $stmt->closeCursor(); it will
throw this error: 'SQLSTATE[HYC00]: Optional feature not implemented'This appears to be a bug, and I haven't found any more info as to its status
lately. Is this correct??
Issue Links
| This issue depends on: | ||||
| ZF-3343 | fetchRow no longer working after revision 9539 |
|
|
|
| This issue is related to: | ||||
| ZF-2097 | Provide unit tests for using bound parameters with stored procedures |
|
|
|
| ZF-348 | Zend_DB: Stored Procedure Example |
|
|
|
| This issue is related to: | ||||
| ZF-5576 | Can't execute subsequent query after multiple queries from same Pdo_Mysql->exec() call |
|
|
|
Good unit tests that execute multiple stored procedures would hopefully expose the problem.