diff options
Diffstat (limited to 'src/backend/tcop')
-rw-r--r-- | src/backend/tcop/dest.c | 3 | ||||
-rw-r--r-- | src/backend/tcop/pquery.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/tcop/dest.c b/src/backend/tcop/dest.c index 2c7dc6e5267..de45cbc4fb8 100644 --- a/src/backend/tcop/dest.c +++ b/src/backend/tcop/dest.c @@ -45,9 +45,10 @@ * dummy DestReceiver functions * ---------------- */ -static void +static bool donothingReceive(TupleTableSlot *slot, DestReceiver *self) { + return true; } static void diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index fcdc4c347c7..3f6cb12b4e5 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -1109,7 +1109,13 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count, if (!ok) break; - (*dest->receiveSlot) (slot, dest); + /* + * If we are not able to send the tuple, we assume the destination + * has closed and no more tuples can be sent. If that's the case, + * end the loop. + */ + if (!((*dest->receiveSlot) (slot, dest))) + break; ExecClearTuple(slot); |