git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ff11e7f)
Fix memory leak when inserting tuple at relation creation for CTAS
2019年2月27日 05:14:06 +0000 (14:14 +0900)
2019年2月27日 05:14:06 +0000 (14:14 +0900)
The leak has been introduced by 763f2ed which has addressed the problem
for transient tables, and forgot CREATE TABLE AS which shares a similar
logic when receiving a new tuple to store into the newly-created
relation.

Author: Jeff Janes
Discussion: https://postgr.es/m/CAMkU=1xZXtz3mziPEPD2Fubbas4G2RWkZm5HHABtfKVcbu1=Sg@mail.gmail.com


diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c
index 2bc8f928eab2c61fcad4cbfbebdd932668f109b8..6517ecb738ac3a5db67f9a51500b1d90e0e81b61 100644 (file)
--- a/src/backend/commands/createas.c
+++ b/src/backend/commands/createas.c
@@ -587,6 +587,9 @@ intorel_receive(TupleTableSlot *slot, DestReceiver *self)
/* We know this is a newly created relation, so there are no indexes */
+ /* Free the copied tuple. */
+ heap_freetuple(tuple);
+
return true;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /