Zend Framework

Zend_Db_Statement_Oracle::fetchObject() throws Exception at end of results

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: N/A N/A
  • Resolution: Duplicate
  • Affects Version/s: 1.5.0
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Db
  • Labels:
    None

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

Activity

Hide
Wil Sinclair added a comment -

Reassigning to Ralph to bring closure to this issue.

Show
Wil Sinclair added a comment - Reassigning to Ralph to bring closure to this issue.
Hide
Mickael Perraud added a comment -

Already corrected by SVN 13705

Show
Mickael Perraud added a comment - Already corrected by SVN 13705

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: