Issues

ZF-6603: fetchAll using column number could return unexpected result set

Issue Type: Bug Created: 2009-05-11T04:03:10.000+0000 Last Updated: 2011-08-04T09:53:03.000+0000 Status: Resolved Fix version(s): - 1.8.3 (09/Jun/09)

Reporter: Tamas Kozak (briwe) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Db

Related issues: - ZF-2112

Attachments:

Description

If you are using fetchAll $col parameter and your raw result set has a value like "NULL" or false fetchAll's while condition stops processing the result set.

Example: array(1000) { [0]=> array(1) { [0]=> string(8) "10045849" } ... [18]=> array(1) { [0]=> string(8) "10045867" } [19]=> array(1) { [0]=> NULL } [20]=> array(1) { [0]=> string(8) "10045869" } ...

If you call fetchAll(Zend_Db::FETCH_NUM, 0) you will get 19 rows back, instead of the expected 1000.

Zend_Db_Statement:328 - while ($val = $this->fetchColumn($col)) {

Comments

Posted by Tamas Kozak (briwe) on 2009-05-11T05:12:21.000+0000

Possible fix:

while (false !== ($val = $this->fetchColumn($col))) {

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-29T08:05:41.000+0000

It duplicates ZF-2112.

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