Zend Framework

Unreachable code

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Db
  • Labels:
    None

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.

$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));
}

Activity

Hide
Mickael Perraud added a comment -

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

Show
Mickael Perraud added a comment - Based on Mysqli, PDO and Db2 files: the 2nd part (exception) should be erased.
Hide
Ralph Schindler added a comment -

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

Show
Ralph Schindler added a comment - Resolved in trunk in r18635 and in branch release 1.9 in r18636

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: