@@ -11,7 +11,7 @@ index bbf220407b..9a82a2db04 100644
11
11
pg_stat_statements \
12
12
pg_surgery \
13
13
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
14
- index d0e5bc26a7..5ca196518e 100644
14
+ index 7a3d9b4b01..0c3d2dec6c 100644
15
15
--- a/src/backend/access/transam/xact.c
16
16
+++ b/src/backend/access/transam/xact.c
17
17
@@ -78,7 +78,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED;
@@ -24,7 +24,7 @@ index d0e5bc26a7..5ca196518e 100644
24
24
bool DefaultXactDeferrable = false;
25
25
bool XactDeferrable;
26
26
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c
27
- index d5e46098c2..d3c02c1def 100644
27
+ index 87c7603f2b..9cc0bc0da8 100644
28
28
--- a/src/backend/executor/execExprInterp.c
29
29
+++ b/src/backend/executor/execExprInterp.c
30
30
@@ -1801,6 +1801,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
@@ -45,7 +45,7 @@ index d5e46098c2..d3c02c1def 100644
45
45
return state->resvalue;
46
46
}
47
47
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
48
- index ef2fd46092..8551733c55 100644
48
+ index 0ba61fd547..29d93998b2 100644
49
49
--- a/src/backend/executor/execMain.c
50
50
+++ b/src/backend/executor/execMain.c
51
51
@@ -826,6 +826,13 @@ InitPlan(QueryDesc *queryDesc, int eflags)
@@ -62,7 +62,7 @@ index ef2fd46092..8551733c55 100644
62
62
/*
63
63
* Next, build the ExecRowMark array from the PlanRowMark(s), if any.
64
64
*/
65
- @@ -2811 ,6 +2818 ,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree)
65
+ @@ -2849 ,6 +2856 ,13 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree)
66
66
rcestate->es_junkFilter = parentestate->es_junkFilter;
67
67
rcestate->es_output_cid = parentestate->es_output_cid;
68
68
@@ -77,7 +77,7 @@ index ef2fd46092..8551733c55 100644
77
77
* ResultRelInfos needed by subplans are initialized from scratch when the
78
78
* subplans themselves are initialized.
79
79
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
80
- index 2f6e66b641..d4a1e48c20 100644
80
+ index 1ad5dcb406..047508e0da 100644
81
81
--- a/src/backend/executor/nodeModifyTable.c
82
82
+++ b/src/backend/executor/nodeModifyTable.c
83
83
@@ -641,6 +641,13 @@ ExecInitUpdateProjection(ModifyTableState *mtstate,
@@ -94,15 +94,15 @@ index 2f6e66b641..d4a1e48c20 100644
94
94
/*
95
95
* ExecGetInsertNewTuple
96
96
* This prepares a "new" tuple ready to be inserted into given result
97
- @@ -3524 ,6 +3531 ,7 @@ ExecModifyTable(PlanState *pstate)
97
+ @@ -3581 ,6 +3588 ,7 @@ ExecModifyTable(PlanState *pstate)
98
98
HeapTupleData oldtupdata;
99
99
HeapTuple oldtuple;
100
100
ItemPointer tupleid;
101
101
+ ResultRelInfo *saved_resultRelInfo;
102
102
103
103
CHECK_FOR_INTERRUPTS();
104
104
105
- @@ -3565 ,6 +3573 ,8 @@ ExecModifyTable(PlanState *pstate)
105
+ @@ -3622 ,6 +3630 ,8 @@ ExecModifyTable(PlanState *pstate)
106
106
context.mtstate = node;
107
107
context.epqstate = &node->mt_epqstate;
108
108
context.estate = estate;
@@ -111,7 +111,7 @@ index 2f6e66b641..d4a1e48c20 100644
111
111
112
112
/*
113
113
* Fetch rows from subplan, and execute the required table modification
114
- @@ -3572 ,6 +3582 ,14 @@ ExecModifyTable(PlanState *pstate)
114
+ @@ -3629 ,6 +3639 ,14 @@ ExecModifyTable(PlanState *pstate)
115
115
*/
116
116
for (;;)
117
117
{
@@ -126,7 +126,7 @@ index 2f6e66b641..d4a1e48c20 100644
126
126
/*
127
127
* Reset the per-output-tuple exprcontext. This is needed because
128
128
* triggers expect to use that context as workspace. It's a bit ugly
129
- @@ -3605 ,7 +3623 ,9 @@ ExecModifyTable(PlanState *pstate)
129
+ @@ -3662 ,7 +3680 ,9 @@ ExecModifyTable(PlanState *pstate)
130
130
bool isNull;
131
131
Oid resultoid;
132
132
@@ -137,7 +137,7 @@ index 2f6e66b641..d4a1e48c20 100644
137
137
&isNull);
138
138
if (isNull)
139
139
{
140
- @@ -3642 ,6 +3662 ,8 @@ ExecModifyTable(PlanState *pstate)
140
+ @@ -3699 ,6 +3719 ,8 @@ ExecModifyTable(PlanState *pstate)
141
141
if (resultRelInfo->ri_usesFdwDirectModify)
142
142
{
143
143
Assert(resultRelInfo->ri_projectReturning);
@@ -146,15 +146,15 @@ index 2f6e66b641..d4a1e48c20 100644
146
146
147
147
/*
148
148
* A scan slot containing the data that was actually inserted,
149
- @@ -3651 ,6 +3673 ,7 @@ ExecModifyTable(PlanState *pstate)
149
+ @@ -3708 ,6 +3730 ,7 @@ ExecModifyTable(PlanState *pstate)
150
150
*/
151
151
slot = ExecProcessReturning(resultRelInfo, NULL, context.planSlot);
152
152
153
153
+ estate->es_result_relation_info = saved_resultRelInfo;
154
154
return slot;
155
155
}
156
156
157
- @@ -3681 ,7 +3704 ,8 @@ ExecModifyTable(PlanState *pstate)
157
+ @@ -3738 ,7 +3761 ,8 @@ ExecModifyTable(PlanState *pstate)
158
158
{
159
159
/* ri_RowIdAttNo refers to a ctid attribute */
160
160
Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo));
@@ -164,7 +164,7 @@ index 2f6e66b641..d4a1e48c20 100644
164
164
resultRelInfo->ri_RowIdAttNo,
165
165
&isNull);
166
166
167
- @@ -3729 ,7 +3753 ,8 @@ ExecModifyTable(PlanState *pstate)
167
+ @@ -3786 ,7 +3810 ,8 @@ ExecModifyTable(PlanState *pstate)
168
168
*/
169
169
else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo))
170
170
{
@@ -174,7 +174,7 @@ index 2f6e66b641..d4a1e48c20 100644
174
174
resultRelInfo->ri_RowIdAttNo,
175
175
&isNull);
176
176
/* shouldn't ever get a null result... */
177
- @@ -3760 ,9 +3785 ,12 @@ ExecModifyTable(PlanState *pstate)
177
+ @@ -3817 ,9 +3842 ,12 @@ ExecModifyTable(PlanState *pstate)
178
178
/* Initialize projection info if first time for this table */
179
179
if (unlikely(!resultRelInfo->ri_projectNewInfoValid))
180
180
ExecInitInsertProjection(node, resultRelInfo);
@@ -190,7 +190,7 @@ index 2f6e66b641..d4a1e48c20 100644
190
190
break;
191
191
192
192
case CMD_UPDATE:
193
- @@ -3770 ,6 +3798 ,13 @@ ExecModifyTable(PlanState *pstate)
193
+ @@ -3827 ,6 +3855 ,13 @@ ExecModifyTable(PlanState *pstate)
194
194
if (unlikely(!resultRelInfo->ri_projectNewInfoValid))
195
195
ExecInitUpdateProjection(node, resultRelInfo);
196
196
@@ -204,7 +204,7 @@ index 2f6e66b641..d4a1e48c20 100644
204
204
/*
205
205
* Make the new tuple by combining plan's output tuple with
206
206
* the old tuple being updated.
207
- @@ -3793 ,14 +3828 ,19 @@ ExecModifyTable(PlanState *pstate)
207
+ @@ -3850 ,14 +3885 ,19 @@ ExecModifyTable(PlanState *pstate)
208
208
slot = ExecGetUpdateNewTuple(resultRelInfo, context.planSlot,
209
209
oldSlot);
210
210
context.relaction = NULL;
@@ -223,10 +223,10 @@ index 2f6e66b641..d4a1e48c20 100644
223
223
+ slot = ExecDelete(&context, estate->es_result_relation_info ?
224
224
+ estate->es_result_relation_info : resultRelInfo,
225
225
+ tupleid, oldtuple,
226
- true, false, node->canSetTag, NULL, NULL);
226
+ true, false, node->canSetTag, NULL, NULL, NULL );
227
227
break;
228
228
229
- @@ -3818 ,7 +3858 ,10 @@ ExecModifyTable(PlanState *pstate)
229
+ @@ -3875 ,7 +3915 ,10 @@ ExecModifyTable(PlanState *pstate)
230
230
* the work on next call.
231
231
*/
232
232
if (slot)
@@ -237,23 +237,23 @@ index 2f6e66b641..d4a1e48c20 100644
237
237
}
238
238
239
239
/*
240
- @@ -3834 ,6 +3877 ,7 @@ ExecModifyTable(PlanState *pstate)
240
+ @@ -3891 ,6 +3934 ,7 @@ ExecModifyTable(PlanState *pstate)
241
241
242
242
node->mt_done = true;
243
243
244
244
+ estate->es_result_relation_info = saved_resultRelInfo;
245
245
return NULL;
246
246
}
247
247
248
- @@ -3908 ,6 +3952 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
248
+ @@ -3965 ,6 +4009 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
249
249
ListCell *l;
250
250
int i;
251
251
Relation rel;
252
252
+ ResultRelInfo *saved_resultRelInfo;
253
253
254
254
/* check for unsupported flags */
255
255
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
256
- @@ -4008 ,6 +4053 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
256
+ @@ -4067 ,6 +4112 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
257
257
i++;
258
258
}
259
259
@@ -267,7 +267,7 @@ index 2f6e66b641..d4a1e48c20 100644
267
267
/*
268
268
* Now we may initialize the subplan.
269
269
*/
270
- @@ -4102 ,6 +4154 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
270
+ @@ -4161 ,6 +4213 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
271
271
ExecInitStoredGenerated(resultRelInfo, estate, operation);
272
272
}
273
273
@@ -303,10 +303,10 @@ index 8d46a781bb..150d70cb64 100644
303
303
304
304
/* flag for logging statements in this transaction */
305
305
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
306
- index 82925b4b63..de23622ca2 100644
306
+ index 7cd9b2f2bf..b31a7934a4 100644
307
307
--- a/src/include/executor/executor.h
308
308
+++ b/src/include/executor/executor.h
309
- @@ -659 ,5 +659 ,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node,
309
+ @@ -662 ,5 +662 ,17 @@ extern ResultRelInfo *ExecLookupResultRelByOid(ModifyTableState *node,
310
310
Oid resultoid,
311
311
bool missing_ok,
312
312
bool update_cache);
@@ -325,7 +325,7 @@ index 82925b4b63..de23622ca2 100644
325
325
326
326
#endif /* EXECUTOR_H */
327
327
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
328
- index f34d06eff4..0970e5f110 100644
328
+ index 9f176b0e37..a65799dcce 100644
329
329
--- a/src/include/nodes/execnodes.h
330
330
+++ b/src/include/nodes/execnodes.h
331
331
@@ -624,6 +624,12 @@ typedef struct EState
@@ -374,7 +374,7 @@ index 8de79c618c..c9226ba5ad 100644
374
374
375
375
sub CopyIncludeFiles
376
376
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
377
- index ef0a33c10f..27033b0a45 100644
377
+ index 990c223a9b..cd5048f8d5 100644
378
378
--- a/src/tools/msvc/Mkvcbuild.pm
379
379
+++ b/src/tools/msvc/Mkvcbuild.pm
380
380
@@ -39,8 +39,8 @@ my $contrib_defines = {};
0 commit comments