mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Drop the temporary tuple slots allocated by pgoutput.
In pgoutput, when converting the child table's tuple format to match the parent table's, we temporarily create a new slot to store the converted tuple. However, we missed to drop such temporary slots, leading to resource leakage. Reported-by: Bowen Shi Author: Hou Zhijie Reviewed-by: Amit Kapila Backpatch-through: 15 Discussion: https://postgr.es/m/CAM_vCudv8dc3sjWiPkXx5F2b27UV7_YRKRbtSCcE-pv=cVACGA@mail.gmail.com
This commit is contained in:
parent
7467939ea2
commit
3e53492aa7
@ -1554,6 +1554,16 @@ cleanup:
|
||||
ancestor = NULL;
|
||||
}
|
||||
|
||||
/* Drop the new slots that were used to store the converted tuples. */
|
||||
if (relentry->attrmap)
|
||||
{
|
||||
if (old_slot)
|
||||
ExecDropSingleTupleTableSlot(old_slot);
|
||||
|
||||
if (new_slot)
|
||||
ExecDropSingleTupleTableSlot(new_slot);
|
||||
}
|
||||
|
||||
MemoryContextSwitchTo(old);
|
||||
MemoryContextReset(data->context);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user