Zend Framework

Zend_DB/Oracle fetchColumn errors on empty rowset

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7.2
  • Fix Version/s: 1.7.4
  • Component/s: Zend_Db_Adapter_Oracle
  • Labels:
    None

Description

Zend/Db/Statement/Oracle function fetchColumn throws an exception when the result set contains no rows.

The base function Zend/DB/Statement checks that there is a result (and returns FALSE if not) before attempting to extract a column, I think the Oracle version should do the same.

--update on 2009/01/19
I initially found this issue by using the fetchOne() statement, so sample code (assume $db is a valid connection to an Oracle database) would be:

// assume $db is a valid connection to an Oracle database
$sql = ('select * from dual where 1=0');
$row = $db->fetchRow($sql); //ok, returns false
$one = $db->fetchOne($sql); //unhandled exception

Issue Links

Activity

Hide
Mickael Perraud added a comment -

Can you give us code? I am not able to reproduce the bug or there is something that i misunderstood.

Show
Mickael Perraud added a comment - Can you give us code? I am not able to reproduce the bug or there is something that i misunderstood.
Hide
Mickael Perraud added a comment -

Fixed with SVN13702

Also resolved an error in unit tests: testStatementFetchColumnEmptyResult(Zend_Db_Statement_OracleTest)

Show
Mickael Perraud added a comment - Fixed with SVN13702 Also resolved an error in unit tests: testStatementFetchColumnEmptyResult(Zend_Db_Statement_OracleTest)
Hide
Satoru Yoshida added a comment -

correct fix version

Show
Satoru Yoshida added a comment - correct fix version

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: