Issues

ZF-5550: Zend_DB/Oracle fetchColumn errors on empty rowset

Issue Type: Bug Created: 2009-01-14T19:18:18.000+0000 Last Updated: 2009-04-01T05:39:29.000+0000 Status: Resolved Fix version(s): - 1.7.4 (02/Feb/09)

Reporter: Brett McBride (brett_mcbride) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db_Adapter_Oracle

Related issues: - ZF-4658

Attachments:

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:

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

Comments

Posted by Mickael Perraud (mikaelkael) on 2009-01-18T01:14:34.000+0000

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

Posted by Mickael Perraud (mikaelkael) on 2009-01-19T13:52:42.000+0000

Fixed with SVN13702

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

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-04-01T05:39:29.000+0000

correct fix version

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