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

Possible fix:

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

It duplicates ZF-2112.