portal->atStart = true;
portal->atEnd = false; /* allow fetches */
portal->portalPos = 0;
- portal->posOverflow = false;
PopActiveSnapshot();
break;
if (portal->queryDesc->myindex == -1)
{
- long oldPos;
-
if (portal->queryDesc->squeue)
{
/* Make sure the producer is advancing */
portal->atStart = false; /* OK to go backward now */
portal->atEnd = portal->queryDesc->estate->es_finished &&
tuplestore_ateof(portal->holdStore);
- oldPos = portal->portalPos;
portal->portalPos += nprocessed;
- /* portalPos doesn't advance when we fall off the end */
- if (portal->portalPos < oldPos)
- portal->posOverflow = true;
}
else
{
SharedQueue squeue = queryDesc->squeue;
int myindex = queryDesc->myindex;
TupleTableSlot *slot;
- long oldPos;
/*
* We are the consumer.
if (count == 0 ||
(unsigned long) nprocessed < (unsigned long) count)
portal->atEnd = true; /* we retrieved 'em all */
- oldPos = portal->portalPos;
portal->portalPos += nprocessed;
- /* portalPos doesn't advance when we fall off the end */
- if (portal->portalPos < oldPos)
- portal->posOverflow = true;
}
/* Mark portal not active */
portal->status = PORTAL_READY;