ZF-5204: Using fetchCol on result where first item is empty results in empty array
Description
select distinct x from y yields an empty array if the data in the first field returned is an empty string. Example data ['',1,2,3].
select distinct x from y yields an empty array if the data in the first field returned is an empty string. Example data ['',1,2,3].
Comments
Posted by Francois (f.verry) on 2009-03-25T06:55:09.000+0000
Problem occurs at Zend/Db/Statement.php {{328: while ($val = $this->fetchColumn($col)) {}}
Since fetchColumn returns false when there is no more results (and false cannot be an SQL value), the following corrects the problem. {{328: while (false !== ($val = $this->fetchColumn($col))) {}}
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-12T05:39:42.000+0000
It duplicates ZF-2112