/* to boost performance, we used virtual mem heap, and we can insert after
* we start retrieving results. The assumption is to
* delete current row right after we retrieve it.
*/
futureRowResultSet.deleteCurrentRow();
RowLocation rl = (RowLocation) ridRow.getColumn(1);
ConglomerateController baseCC = activation.getHeapConglomerateController();
if (sparseRow == null)
getSparseRowAndMap();
baseCC.fetch(
rl, sparseRow.getRowArray(), sparseRowMap);
RowLocation rl2 = (RowLocation) rl.getClone();
currentRow.setColumn(currentRow.nColumns(), rl2);
candidate.setColumn(candidate.nColumns(), rl2); // have to be consistent!
result = currentRow;
currentRowPrescanned = true;
}
else if (sourceDrained)
{
currentRowPrescanned = true;
currentRow = null;
}
if (currentRowPrescanned)
{
setCurrentRow(result);
nextTime += getElapsedMillis(beginTime);
return result;
}
}
}
if ( isOpen && !nextDone)
{
/* Only need to do 1 next per scan
* for 1 row scans.
*/
nextDone = oneRowScan;
if (scanControllerOpened)
{
boolean moreRows;
while (moreRows =
scanController.fetchNext(candidate.getRowArray()))
{
rowsSeen++;
rowsThisScan++;
/*
** Skip rows where there are start or stop positioners
** that do not implement ordered null semantics and
** there are columns in those positions that contain
** null.
** No need to check if start and stop positions are the
** same, since all predicates in both will be ='s,
** and hence evaluated in the store.
*/
if ((! sameStartStopPosition) && skipRow(candidate))
{
rowsFiltered++;
continue;
}
/* beetle 3865, updateable cursor use index. If we have a hash table that
* holds updated records, and we hit it again, skip it, and remove it from
* hash since we can't hit it again, and we have a space in hash, so can
* stop scanning forward.
*/
if (past2FutureTbl != null)
{
RowLocation rowLoc = (RowLocation) currentRow.getColumn(currentRow.nColumns());
if (past2FutureTbl.get(rowLoc) != null)
{
past2FutureTbl.remove(rowLoc);
continue;
}