diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-12-04 10:33:09 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-12-04 10:39:24 -0500 |
commit | 9f4992e2a9939a4c3d560c2ac58067861ee0029a (patch) | |
tree | 17585b681afb8a5b635c1b6f354c43a4c7a8bc4c /src/backend/executor/tqueue.c | |
parent | a852cfe96752b25c2deaa2653cffd60c0ec82ead (diff) | |
download | postgresql-9f4992e2a9939a4c3d560c2ac58067861ee0029a.tar.gz postgresql-9f4992e2a9939a4c3d560c2ac58067861ee0029a.zip |
Remove memory leak protection from Gather and Gather Merge nodes.
Before commit 6b65a7fe62e129d5c2b85cd74d6a91d8f7564608, tqueue.c could
perform tuple remapping and thus leak memory, which is why commit
af33039317ddc4a0e38a02e2255c2bf453115fd2 made TupleQueueReaderNext
run in a short-lived context. Now, however, tqueue.c has been reduced
to a shadow of its former self, and there shouldn't be any chance of
leaks any more. Accordingly, remove some tuple copying and memory
context manipulation to speed up processing.
Patch by me, reviewed by Amit Kapila. Some testing by Rafia Sabih.
Discussion: http://postgr.es/m/CAA4eK1LSDydwrNjmYSNkfJ3ZivGSWH9SVswh6QpNzsMdj_oOQA@mail.gmail.com
Diffstat (limited to 'src/backend/executor/tqueue.c')
-rw-r--r-- | src/backend/executor/tqueue.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/executor/tqueue.c b/src/backend/executor/tqueue.c index 4a295c936ba..0dcb911c3c0 100644 --- a/src/backend/executor/tqueue.c +++ b/src/backend/executor/tqueue.c @@ -161,6 +161,8 @@ DestroyTupleQueueReader(TupleQueueReader *reader) * is set to true when there are no remaining tuples and otherwise to false. * * The returned tuple, if any, is allocated in CurrentMemoryContext. + * Note that this routine must not leak memory! (We used to allow that, + * but not any more.) * * Even when shm_mq_receive() returns SHM_MQ_WOULD_BLOCK, this can still * accumulate bytes from a partially-read message, so it's useful to call |