@@ -1,5 +1,5 @@ diff --git a/contrib/Makefile b/contrib/Makefile indexf27e458482..ea47c341c1 100644 indexf27e458482e..ea47c341c11 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -32,6 +32,7 @@ SUBDIRS = \ Expand All @@ -11,7 +11,7 @@ index f27e458482..ea47c341c1 100644 pg_stat_statements \ pg_surgery\ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c indexbf551b0395..10d2044ae6 100644 index3f0f711307d..a631b969e25 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -76,7 +76,7 @@ intDefaultXactIsoLevel = XACT_READ_COMMITTED; Expand All @@ -24,10 +24,10 @@ index bf551b0395..10d2044ae6 100644 boolDefaultXactDeferrable = false; boolXactDeferrable; diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c indexbdf59a10fc..972453d9a5 100644 index4b31a85a24d..5366e67877a 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -1799 ,6 +1799 ,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) @@ -1811 ,6 +1811 ,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) } out: Expand All @@ -45,10 +45,10 @@ index bdf59a10fc..972453d9a5 100644 return state->resvalue; } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c indexb3ce4bae53..8f2bb12542 100644 index5d6410480cd..33a522514d9 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -824 ,6 +824 ,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) @@ -818 ,6 +818 ,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) estate->es_plannedstmt = plannedstmt; Expand All @@ -62,7 +62,7 @@ index b3ce4bae53..8f2bb12542 100644 /* * Next, build the ExecRowMark array from the PlanRowMark(s), if any. */ @@ -2713 ,6 +2720 ,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) @@ -2777 ,6 +2784 ,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree) rcestate->es_junkFilter = parentestate->es_junkFilter; rcestate->es_output_cid = parentestate->es_output_cid; Expand All @@ -77,10 +77,10 @@ index b3ce4bae53..8f2bb12542 100644 * ResultRelInfos needed by subplans are initialized from scratch when the * subplans themselves are initialized. diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index55c430c9ec..21d9e6304a 100644 indexae1b07847b1..989ba4f7b11 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -510 ,7 +510 ,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate, @@ -538 ,7 +538 ,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate, * This is also a convenient place to verify that the output of an UPDATE * matches the target table (ExecBuildUpdateProjection does that). */ Expand All @@ -89,15 +89,15 @@ index 55c430c9ec..21d9e6304a 100644 ExecInitUpdateProjection(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo) { @@ -2486,6 +2486,7 @@ ExecModifyTable(PlanState *pstate) ItemPointerData tuple_ctid; @@ -2541,6 +2541,7 @@ ExecModifyTable(PlanState *pstate) HeapTupleData oldtupdata; HeapTupleoldtuple; booltuplock; +ResultRelInfo *saved_resultRelInfo; CHECK_FOR_INTERRUPTS(); @@ -2523 ,12 +2524 ,23 @@ ExecModifyTable(PlanState *pstate) @@ -2578 ,12 +2579 ,23 @@ ExecModifyTable(PlanState *pstate) resultRelInfo = node->resultRelInfo + node->mt_lastResultIndex; subplanstate = outerPlanState(node); Expand All @@ -121,7 +121,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Reset the per-output-tuple exprcontext. This is needed because * triggers expect to use that context as workspace. It's a bit ugly @@ -2562 ,7 +2574 ,9 @@ ExecModifyTable(PlanState *pstate) @@ -2617 ,7 +2629 ,9 @@ ExecModifyTable(PlanState *pstate) boolisNull; Oidresultoid; Expand All @@ -132,7 +132,7 @@ index 55c430c9ec..21d9e6304a 100644 &isNull); if (isNull) elog(ERROR, "tableoid is NULL"); @@ -2581 ,6 +2595 ,8 @@ ExecModifyTable(PlanState *pstate) @@ -2636 ,6 +2650 ,8 @@ ExecModifyTable(PlanState *pstate) if (resultRelInfo->ri_usesFdwDirectModify) { Assert(resultRelInfo->ri_projectReturning); Expand All @@ -141,15 +141,15 @@ index 55c430c9ec..21d9e6304a 100644 /* * A scan slot containing the data that was actually inserted, @@ -2590 ,6 +2606 ,7 @@ ExecModifyTable(PlanState *pstate) @@ -2645 ,6 +2661 ,7 @@ ExecModifyTable(PlanState *pstate) */ slot = ExecProcessReturning(resultRelInfo, NULL, planSlot); +estate->es_result_relation_info = saved_resultRelInfo; return slot; } @@ -2619 ,7 +2636 ,8 @@ ExecModifyTable(PlanState *pstate) @@ -2674 ,7 +2691 ,8 @@ ExecModifyTable(PlanState *pstate) { /* ri_RowIdAttNo refers to a ctid attribute */ Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)); Expand All @@ -159,7 +159,7 @@ index 55c430c9ec..21d9e6304a 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ @@ -2649 ,7 +2667 ,8 @@ ExecModifyTable(PlanState *pstate) @@ -2704 ,7 +2722 ,8 @@ ExecModifyTable(PlanState *pstate) */ else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo)) { Expand All @@ -169,7 +169,7 @@ index 55c430c9ec..21d9e6304a 100644 resultRelInfo->ri_RowIdAttNo, &isNull); /* shouldn't ever get a null result... */ @@ -2680 ,8 +2699 ,12 @@ ExecModifyTable(PlanState *pstate) @@ -2735 ,8 +2754 ,12 @@ ExecModifyTable(PlanState *pstate) /* Initialize projection info if first time for this table */ if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitInsertProjection(node, resultRelInfo); Expand All @@ -184,7 +184,7 @@ index 55c430c9ec..21d9e6304a 100644 estate, node->canSetTag); break; case CMD_UPDATE: @@ -2689 ,6 +2712 ,13 @@ ExecModifyTable(PlanState *pstate) @@ -2746 ,6 +2769 ,13 @@ ExecModifyTable(PlanState *pstate) if (unlikely(!resultRelInfo->ri_projectNewInfoValid)) ExecInitUpdateProjection(node, resultRelInfo); Expand All @@ -198,7 +198,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Make the new tuple by combining plan's output tuple with * the old tuple being updated. @@ -2712,14 +2742,19 @@ ExecModifyTable(PlanState *pstate) @@ -2775,9 +2805,12 @@ ExecModifyTable(PlanState *pstate) } slot = ExecGetUpdateNewTuple(resultRelInfo, planSlot, oldSlot); Expand All @@ -211,6 +211,9 @@ index 55c430c9ec..21d9e6304a 100644 + tupleid, oldtuple, slot, planSlot, &node->mt_epqstate, estate, node->canSetTag); if (tuplock) @@ -2785,7 +2818,9 @@ ExecModifyTable(PlanState *pstate) InplaceUpdateTupleLock); break; case CMD_DELETE: -slot = ExecDelete(node, resultRelInfo, tupleid, oldtuple, Expand All @@ -220,7 +223,7 @@ index 55c430c9ec..21d9e6304a 100644 planSlot, &node->mt_epqstate, estate, true, /* processReturning */ node->canSetTag, @@ -2736 ,7 +2771 ,10 @@ ExecModifyTable(PlanState *pstate) @@ -2802 ,7 +2837 ,10 @@ ExecModifyTable(PlanState *pstate) * the work on next call. */ if (slot) Expand All @@ -231,23 +234,23 @@ index 55c430c9ec..21d9e6304a 100644 } /* @@ -2752 ,6 +2790 ,7 @@ ExecModifyTable(PlanState *pstate) @@ -2818 ,6 +2856 ,7 @@ ExecModifyTable(PlanState *pstate) node->mt_done = true; +estate->es_result_relation_info = saved_resultRelInfo; return NULL; } @@ -2826 ,6 +2865 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) @@ -2892 ,6 +2931 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ListCell *l; inti; Relationrel; +ResultRelInfo *saved_resultRelInfo; /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); @@ -2922 ,6 +2962 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) @@ -2991 ,6 +3031 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) i++; } Expand All @@ -261,7 +264,7 @@ index 55c430c9ec..21d9e6304a 100644 /* * Now we may initialize the subplan. */ @@ -3002 ,6 +3049 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) @@ -3071 ,6 +3118 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) ExecInitStoredGenerated(resultRelInfo, estate, operation); } Expand All @@ -271,7 +274,7 @@ index 55c430c9ec..21d9e6304a 100644 * If this is an inherited update/delete, there will be a junk attribute * named "tableoid" present in the subplan's targetlist. It will be used diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c index381d9e548d..0a4657d291 100644 index381d9e548d1..0a4657d2915 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -25,7 +25,7 @@ Expand All @@ -284,7 +287,7 @@ index 381d9e548d..0a4657d291 100644 volatile sig_atomic_t InterruptPending = false; volatile sig_atomic_t QueryCancelPending = false; diff --git a/src/include/access/xact.h b/src/include/access/xact.h index5af78bd0dc..0c13bc9d83 100644 index5af78bd0dc7..0c13bc9d83b 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -53,7 +53,9 @@ extern PGDLLIMPORT int XactIsoLevel; Expand All @@ -299,7 +302,7 @@ index 5af78bd0dc..0c13bc9d83 100644 /* flag for logging statements in this transaction */ extern bool xact_is_sampled; diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h index2b4e104bb9..80d1274efe 100644 index3903e7a6f2e..49509a56c2d 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -28,7 +28,7 @@ typedef struct ObjectAddress Expand All @@ -312,10 +315,10 @@ index 2b4e104bb9..80d1274efe 100644 #define ObjectAddressSubSet(addr, class_id, object_id, object_sub_id) \ do { \ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index3dc03c913e..1002d97499 100644 index4bb1744286a..af86e081918 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -657 ,5 +657 ,7 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, @@ -663 ,5 +663 ,7 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache); Expand All @@ -324,7 +327,7 @@ index 3dc03c913e..1002d97499 100644 #endif/* EXECUTOR_H */ diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index4acb1cda6e..fd8d38347d 100644 index4acb1cda6ea..fd8d38347d3 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -327,7 +327,7 @@ extern ssize_t be_gssapi_read(Port *port, void *ptr, size_t len); Expand All @@ -337,10 +340,10 @@ index 4acb1cda6e..fd8d38347d 100644 /* TCP keepalives configuration. These are no-ops on an AF_UNIX socket. */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h indexee5ad3c058..dc474819d7 100644 index801d7630e9d..400814f0618 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -592 ,6 +592 ,12 @@ typedef struct EState @@ -593 ,6 +593 ,12 @@ typedef struct EState * es_result_relations in no * specific order */ Expand All @@ -354,7 +357,7 @@ index ee5ad3c058..dc474819d7 100644 /* diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index33e6c14e81..abd9bba23e 100644 index33e6c14e819..abd9bba23e3 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -53,7 +53,7 @@ extern TimestampTz GetSnapshotCurrentTimestamp(void); Expand All @@ -367,7 +370,7 @@ index 33e6c14e81..abd9bba23e 100644 extern PGDLLIMPORT TransactionId TransactionXmin; extern PGDLLIMPORT TransactionId RecentXmin; diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm indexde22c9ba2c..c8be5323b8 100644 indexde22c9ba2c7..c8be5323b8f 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -30,6 +30,18 @@ my @client_program_files = ( Expand Down Expand Up @@ -399,7 +402,7 @@ index de22c9ba2c..c8be5323b8 100644 sub CopyIncludeFiles diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index9b6539fb15..f8a67c6701 100644 index43880a0a34c..ce7b8f7ac72 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -41,7 +41,10 @@ my @contrib_uselibpq = Expand All @@ -414,15 +417,15 @@ index 9b6539fb15..f8a67c6701 100644 my $contrib_extrasource = { 'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ], 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], @@ -973 ,6 +976 ,7 @@ sub AddContrib @@ -977 ,6 +980 ,7 @@ sub AddContrib my $dn = $1; my $proj = $solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n"); $proj->AddReference($postgres); +$proj->RemoveFile("$subdir/$n/src/declarative.c") if $n eq 'pg_pathman'; AdjustContribProj($proj); } elsif ($mf =~ /^MODULES\s*=\s*(.*)$/mg) @@ -1002 ,6 +1006 ,19 @@ sub AddContrib @@ -1006 ,6 +1010 ,19 @@ sub AddContrib return; } Expand All @@ -442,7 +445,7 @@ index 9b6539fb15..f8a67c6701 100644 sub GenerateContribSqlFiles { my $n = shift; @@ -1026 ,23 +1043 ,53 @@ sub GenerateContribSqlFiles @@ -1030 ,23 +1047 ,53 @@ sub GenerateContribSqlFiles substr($l, 0, index($l, '$(addsuffix ')) . substr($l, $i + 1); } Expand Down