Issues

ZF-2962: Zend_Db_Statement_Oracle::fetchObject() throws Exception at end of results

Issue Type: Bug Created: 2008-03-24T20:44:49.000+0000 Last Updated: 2009-10-18T02:26:19.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: Terry Katz (tkatz) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db

Related issues: - ZF-5583

Attachments:

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:

<pre class="highlight">
$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:

<pre class="highlight">
$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.

Comments

Posted by Wil Sinclair (wil) on 2009-01-13T10:37:10.000+0000

Reassigning to Ralph to bring closure to this issue.

Posted by Mickael Perraud (mikaelkael) on 2009-10-18T02:26:16.000+0000

Already corrected by SVN 13705

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts