Mantis - Quercus
Viewing Issue Advanced Details
4368 minor always 02-01-11 07:51 02-01-11 07:51
geleont  
 
normal  
new  
open  
none    
none  
0004368: pg_fetch_array(result, row, field); with row fiels set to null never go to next row
Minimal code to reproduce:
$sql = 'SELECT * FROM table ';
$result = pg_query($res, $sql);
while ($row = pg_fetch_array($result, NULL, PGSQL_ASSOC)) {
        print_r($row);
}
During research I found that this problem caused by this lines of code so
if (row.isNull()) {
        if (result.getPassedNullRow()) {
          result.setPassedNullRow();
        } else {
          // Step the cursor back to the previous position
          ResultSet rs = result.getResultSet();
          rs.previous();
        }
      }
as we can see result.setPassedNullRow(); never be executed
Also from researching quercus sources I found that we can set row argument equal -1 to make function work as expected

There are no notes attached to this issue.