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

Bug #598 IFX fetchrow() broken
Submitted: 2004-01-19 16:51 UTC
From: andres at alleati dot com Assigned: danielc
Status: Closed Package: DB
PHP Version: 4.3.2 OS: win2000
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 6 + 18 = ?

 
 [2004-01-19 16:51 UTC] andres at alleati dot com
Description: ------------ While testing some code using the ifx driver, i noticed that fetchRow() returned the same row everytime it was called. I went to the file ifx.php and changed the call to "ifx_fetch_row" in the "fetchInto" method: line 227: if (!$row = @ifx_fetch_row($result, $rownum)) { to if (!$row = @ifx_fetch_row($result, "NEXT")) { I am pretty sure this is not the way to solve it but it is what i did untill there is an official bugfix. Reproduce code: --------------- [...] $dsn = "ifx://user:pass@host/dbname"; [...] while ($row = $result->fetchRow()){ echo $row['id'].'<br>'; } Expected result: ---------------- 16<br> 17<br> 18<br> 19<br> 20<br> 21<br> Actual result: -------------- 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> 16<br> (untile time out is reached)

Comments

 [2004-01-22 20:11 UTC] danielc
peterw was unable to duplciate. Is in direct communication with the reporter.
 [2004-01-22 21:43 UTC] danielc
Can you please apply this patch and let me know what happens? Index: ifx.php =================================================================== RCS file: /repository/pear/DB/DB/ifx.php,v retrieving revision 1.24 diff -u -r1.24 ifx.php --- ifx.php 19 Jan 2004 20:10:39 -0000 1.24 +++ ifx.php 22 Jan 2004 19:50:30 -0000 @@ -232,7 +232,9 @@ if (($rownum !== null) && ($rownum < 0)) { return null; } - // if $rownum is null, fetch row will return the next row + if ($rownum === null) { + $rownum = 'NEXT'; + } if (!$arr = @ifx_fetch_row($result, $rownum)) { return null; }
 [2004-01-27 18:03 UTC] danielc
The patch above was applied to CVS. Tests indicated that this didn't break anything and probably resoles the users issue.