ZF-6603: fetchAll using column number could return unexpected result set
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.