Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #670 fetchCol error on empty result
Submitted: 2004-02-02 23:15 UTC
From: ths at php dot net Assigned: lsmith
Status: Closed Package: MDB
PHP Version: 4.3.4 OS: WinXP
Roadmaps: (Not assigned)    

 [2004-02-02 23:15 UTC] ths at php dot net
Description: ------------ fetchCol() trows an MDB_ERROR_TRUNCATED when the query should returns an empty resultset. Maybe because fetchinto returns as first row: array(1) { [0]=> NULL } ?? latest CVS version, mySQL.


 [2004-02-03 17:41 UTC] lsmith
uhm in that case the result set was not empty but the data in the first row of the column you are fetching is NULL .. correct?
 [2004-02-03 19:14 UTC] lsmith
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.
 [2004-06-18 15:17 UTC] ths
Sorry, a little late... Is it expected behavior to get the following result? array(1) { [""]=> NULL } I get this using fetchAll with $rekey=true on the following query on MySQL: SELECT lang_mode.mode, lang_mode.visible FROM lang LEFT OUTER JOIN lang_mode ON WHERE Expected result is: array(0) { } in case of an empty table lang_mode and an existing entry with pk=4 in table lang.
 [2004-06-18 15:35 UTC] smith at backendmedia dot com
yes thats the expected behavoir. anything else would require special attention which would make the common case slower. This issue is not related to fetchCol obviously so if you have any further comments please open a new bug report.