Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit650663b

Browse files
committed
Use appropriate tuple descriptor in FDW batching
The FDW batching code was using the same tuple descriptor both for allslots (regular and plan slots), but that's incorrect - the subplan mayuse a different descriptor. Currently this is benign, because batchingis used only for INSERTs, and in that case the descriptors always match.But that would change if we allow batching UPDATEs.Fix by copying the appropriate tuple descriptor. Backpatch to 14, wherethe FDW batching was implemented.Author: Amit LangoteBackpatch-through: 14, where FDW batching was addedDiscussion:https://postgr.es/m/CA%2BHiwqEWd5B0-e-RvixGGUrNvGkjH2s4m95%3DJcwUnyV%3Df0rAKQ%40mail.gmail.com
1 parentba95829 commit650663b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/executor/nodeModifyTable.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,19 @@ ExecInsert(ModifyTableState *mtstate,
709709
* keep them across batches. To mitigate an inefficiency in how
710710
* resource owner handles objects with many references (as with
711711
* many slots all referencing the same tuple descriptor) we copy
712-
* the tuple descriptor for each slot.
712+
* theappropriatetuple descriptor for each slot.
713713
*/
714714
if (resultRelInfo->ri_NumSlots >=resultRelInfo->ri_NumSlotsInitialized)
715715
{
716716
TupleDesctdesc=CreateTupleDescCopy(slot->tts_tupleDescriptor);
717+
TupleDescplan_tdesc=
718+
CreateTupleDescCopy(planSlot->tts_tupleDescriptor);
717719

718720
resultRelInfo->ri_Slots[resultRelInfo->ri_NumSlots]=
719721
MakeSingleTupleTableSlot(tdesc,slot->tts_ops);
720722

721723
resultRelInfo->ri_PlanSlots[resultRelInfo->ri_NumSlots]=
722-
MakeSingleTupleTableSlot(tdesc,planSlot->tts_ops);
724+
MakeSingleTupleTableSlot(plan_tdesc,planSlot->tts_ops);
723725

724726
/* remember how many batch slots we initialized */
725727
resultRelInfo->ri_NumSlotsInitialized++;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp