Issues

ZF-7887: Unreachable code

Issue Type: Bug Created: 2009-09-18T07:58:04.000+0000 Last Updated: 2009-10-16T22:45:19.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: Brian Tipton (tiptone) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

Related issues: Attachments:

Description

This is actually for Zend_Db_Statement_Oracle, but that doesn't show up in the list of Components.

I'm looking at version 1.9.2 (Minimal). In Zend/Db/Statement/Oracle.php in the _execute() function there is some unreachable code. The same conditional is checked twice, and there's a return false after the first one, so the throwing of the exception is unreachable in the seconde. The coding style is also different for the two conditionals, one with and one without a space between the ! and the $this->_stmt.

<pre class="highlight">
$connection = $this->_adapter->getConnection();
if (!$this->_stmt) {
    return false;
}

if (! $this->_stmt) {
    /**
     * @see Zend_Db_Adapter_Oracle_Exception
     */
    require_once 'Zend/Db/Statement/Oracle/Exception.php';
    throw new Zend_Db_Statement_Oracle_Exception(oci_error($connection));
}

Comments

Posted by Mickael Perraud (mikaelkael) on 2009-10-05T05:19:22.000+0000

Based on Mysqli, PDO and Db2 files: the 2nd part (exception) should be erased.

Posted by Ralph Schindler (ralph) on 2009-10-16T22:45:18.000+0000

Resolved in trunk in r18635 and in branch release 1.9 in r18636

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