Details
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)) {
Issue Links
| This issue duplicates: | ||||
| ZF-2112 | Zend_Db_Adapter_Interface::fetchCol() does not properly retrieve a column on single column SQL statements. |
|
|
|
Possible fix:
while (false !== ($val = $this->fetchColumn($col))) {