Zend Framework

Zend_Db_Statement_Mysqli and Zend_Validate_Db_* problems with strict typing on fetch

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.7.3
  • Fix Version/s: 1.9.3
  • Component/s: Zend_Db
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

Description

Zend_Db_Adapter_Mysqli does not return consistent null for failed matches using fetch() from the statement class due to
// fetch the next result
$retval = $this->_stmt->fetch();
switch ($retval) { case null: // end of data case false: // error occurred $this->_stmt->reset(); return $retval; default: // fallthrough }

it should return false like every other class if it is going to work with zend_validate_db_*'s
if ($result !== false) {

Activity

Hide
Ryan Mauger added a comment -

After discussion with Ralph Schindler, the strict equality checking has been changed in commit 14028

Show
Ryan Mauger added a comment - After discussion with Ralph Schindler, the strict equality checking has been changed in commit 14028
Hide
Thomas Weidner added a comment -

Erasing Zend_Validate_* as there is actually no DB validator in core.

Show
Thomas Weidner added a comment - Erasing Zend_Validate_* as there is actually no DB validator in core.
Hide
Ralph Schindler added a comment -

After discussing with Ryan Mauger we should return false as the $retval for consistency with other adapters. Null has no real semantic meaning in Zend_Db_Statement.

Evaluating and assigning to Ryan Mauger

Show
Ralph Schindler added a comment - After discussing with Ryan Mauger we should return false as the $retval for consistency with other adapters. Null has no real semantic meaning in Zend_Db_Statement. Evaluating and assigning to Ryan Mauger
Hide
Ryan Mauger added a comment -

commited to 1.9 release branch in r18195

Show
Ryan Mauger added a comment - commited to 1.9 release branch in r18195

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: