Details
Description
Zend_Db_Statement_Oracle::fetchObject() wraps oci_fetch_object() which returns "false" when there are no more rows to retrieve.
The current implementation throws an exception when false is returned:
$obj = oci_fetch_object($this->_stmt); if ($obj === false) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Statement/Oracle/Exception.php'; throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); }
I suggest changing it to something similar to how Zend_Db_Statement_Oracle::fetch() method works. Something like:
$obj = oci_fetch_object($this->_stmt); if ($obj === false && $error = oci_error($this->_stmt) ) { /** * @see Zend_Db_Adapter_Oracle_Exception */ require_once 'Zend/Db/Statement/Oracle/Exception.php'; throw new Zend_Db_Statement_Oracle_Exception($error); }
which should only throw an exception if an actual error ocurred.
Issue Links
| This issue is duplicated by: | ||||
| ZF-5583 | Failure with Zend_Db_Statement_Oracle unit test |
|
|
|
Reassigning to Ralph to bring closure to this issue.