Skip to content

Commit

Permalink
Init foreign modify state early like it's done in 6.6.0 (#73)
Browse files Browse the repository at this point in the history
The changes made in 27b899d moved
initialization of fdw global state to later phase - from pxfBeginForeignModify()
to pxfExecForeignInsert(). This may break another projects which depend on pxf
fdw. The patch temporary restores old behavior.
  • Loading branch information
Alexey Gordeev authored Dec 5, 2023
1 parent 242956a commit a4999c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fdw/pxf_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,18 @@ pxfBeginForeignModify(ModifyTableState *mtstate,
* external resource in the QD node, when all the actual insertions happen
* in the segments.
*/
/* begin of temp block */
/*
* Previously, ri_FdwState initialized here, but not in
* pxfExecForeignInsert(). This was optimized, but unfortunately, there may
* be some external projects that depend on old behavior. Here we do a temp
* fix, which restores old behavior.
*/
if (eflags & EXEC_FLAG_EXPLAIN_ONLY)
return;
if (!resultRelInfo->ri_FdwState)
resultRelInfo->ri_FdwState = InitForeignModify(resultRelInfo->ri_RelationDesc);
/* end of temp block */
}

/*
Expand Down

0 comments on commit a4999c5

Please sign in to comment.