@@ -11,7 +11,7 @@ index f27e458482..ea47c341c1 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 ca6f6d57d3..8ab313b910 100644
14
+ index bf551b0395..10d2044ae6 100644
15
15
--- a/src/backend/access/transam/xact.c
16
16
+++ b/src/backend/access/transam/xact.c
17
17
@@ -76,7 +76,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED;
@@ -24,7 +24,7 @@ index ca6f6d57d3..8ab313b910 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 5483dee650..e2864e6ae9 100644
27
+ index 6b63f93e6d..060146d127 100644
28
28
--- a/src/backend/executor/execExprInterp.c
29
29
+++ b/src/backend/executor/execExprInterp.c
30
30
@@ -1799,6 +1799,16 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
@@ -77,10 +77,10 @@ index b3ce4bae53..8f2bb12542 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 d328856ae5..27235ec869 100644
80
+ index 0780554246..a90f3a495d 100644
81
81
--- a/src/backend/executor/nodeModifyTable.c
82
82
+++ b/src/backend/executor/nodeModifyTable.c
83
- @@ -450 ,7 +450 ,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate,
83
+ @@ -510 ,7 +510 ,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate,
84
84
* This is also a convenient place to verify that the output of an UPDATE
85
85
* matches the target table (ExecBuildUpdateProjection does that).
86
86
*/
@@ -89,15 +89,15 @@ index d328856ae5..27235ec869 100644
89
89
ExecInitUpdateProjection(ModifyTableState *mtstate,
90
90
ResultRelInfo *resultRelInfo)
91
91
{
92
- @@ -2363 ,6 +2363 ,7 @@ ExecModifyTable(PlanState *pstate)
93
- PartitionTupleRouting *proute = node->mt_partition_tuple_routing ;
94
- List *relinfos = NIL ;
95
- ListCell *lc ;
92
+ @@ -2487 ,6 +2487 ,7 @@ ExecModifyTable(PlanState *pstate)
93
+ ItemPointerData tuple_ctid ;
94
+ HeapTupleData oldtupdata ;
95
+ HeapTuple oldtuple ;
96
96
+ ResultRelInfo *saved_resultRelInfo;
97
97
98
98
CHECK_FOR_INTERRUPTS();
99
99
100
- @@ -2400 ,12 +2401 ,23 @@ ExecModifyTable(PlanState *pstate)
100
+ @@ -2524 ,12 +2525 ,23 @@ ExecModifyTable(PlanState *pstate)
101
101
resultRelInfo = node->resultRelInfo + node->mt_lastResultIndex;
102
102
subplanstate = outerPlanState(node);
103
103
@@ -111,7 +111,7 @@ index d328856ae5..27235ec869 100644
111
111
for (;;)
112
112
{
113
113
+ /*
114
- + * "es_original_tuple" should contain original modified tuple (new
114
+ + * "es_original_tuple" should contains original modified tuple (new
115
115
+ * values of the changed columns plus row identity information such as
116
116
+ * CTID) in case tuple planSlot is replaced in pg_pathman to new value
117
117
+ * in call "ExecProcNode(subplanstate)".
@@ -121,7 +121,7 @@ index d328856ae5..27235ec869 100644
121
121
/*
122
122
* Reset the per-output-tuple exprcontext. This is needed because
123
123
* triggers expect to use that context as workspace. It's a bit ugly
124
- @@ -2439 ,7 +2451 ,9 @@ ExecModifyTable(PlanState *pstate)
124
+ @@ -2563 ,7 +2575 ,9 @@ ExecModifyTable(PlanState *pstate)
125
125
bool isNull;
126
126
Oid resultoid;
127
127
@@ -132,7 +132,7 @@ index d328856ae5..27235ec869 100644
132
132
&isNull);
133
133
if (isNull)
134
134
elog(ERROR, "tableoid is NULL");
135
- @@ -2458 ,6 +2472 ,8 @@ ExecModifyTable(PlanState *pstate)
135
+ @@ -2582 ,6 +2596 ,8 @@ ExecModifyTable(PlanState *pstate)
136
136
if (resultRelInfo->ri_usesFdwDirectModify)
137
137
{
138
138
Assert(resultRelInfo->ri_projectReturning);
@@ -141,15 +141,15 @@ index d328856ae5..27235ec869 100644
141
141
142
142
/*
143
143
* A scan slot containing the data that was actually inserted,
144
- @@ -2467 ,6 +2483 ,7 @@ ExecModifyTable(PlanState *pstate)
144
+ @@ -2591 ,6 +2607 ,7 @@ ExecModifyTable(PlanState *pstate)
145
145
*/
146
146
slot = ExecProcessReturning(resultRelInfo, NULL, planSlot);
147
147
148
148
+ estate->es_result_relation_info = saved_resultRelInfo;
149
149
return slot;
150
150
}
151
151
152
- @@ -2496 ,7 +2513 ,8 @@ ExecModifyTable(PlanState *pstate)
152
+ @@ -2620 ,7 +2637 ,8 @@ ExecModifyTable(PlanState *pstate)
153
153
{
154
154
/* ri_RowIdAttNo refers to a ctid attribute */
155
155
Assert(AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo));
@@ -159,7 +159,7 @@ index d328856ae5..27235ec869 100644
159
159
resultRelInfo->ri_RowIdAttNo,
160
160
&isNull);
161
161
/* shouldn't ever get a null result... */
162
- @@ -2526 ,7 +2544 ,8 @@ ExecModifyTable(PlanState *pstate)
162
+ @@ -2650 ,7 +2668 ,8 @@ ExecModifyTable(PlanState *pstate)
163
163
*/
164
164
else if (AttributeNumberIsValid(resultRelInfo->ri_RowIdAttNo))
165
165
{
@@ -169,7 +169,7 @@ index d328856ae5..27235ec869 100644
169
169
resultRelInfo->ri_RowIdAttNo,
170
170
&isNull);
171
171
/* shouldn't ever get a null result... */
172
- @@ -2557 ,8 +2576 ,12 @@ ExecModifyTable(PlanState *pstate)
172
+ @@ -2681 ,8 +2700 ,12 @@ ExecModifyTable(PlanState *pstate)
173
173
/* Initialize projection info if first time for this table */
174
174
if (unlikely(!resultRelInfo->ri_projectNewInfoValid))
175
175
ExecInitInsertProjection(node, resultRelInfo);
@@ -184,7 +184,7 @@ index d328856ae5..27235ec869 100644
184
184
estate, node->canSetTag);
185
185
break;
186
186
case CMD_UPDATE:
187
- @@ -2566 ,37 +2589 ,45 @@ ExecModifyTable(PlanState *pstate)
187
+ @@ -2690 ,37 +2713 ,45 @@ ExecModifyTable(PlanState *pstate)
188
188
if (unlikely(!resultRelInfo->ri_projectNewInfoValid))
189
189
ExecInitUpdateProjection(node, resultRelInfo);
190
190
@@ -253,7 +253,7 @@ index d328856ae5..27235ec869 100644
253
253
planSlot, &node->mt_epqstate, estate,
254
254
true, /* processReturning */
255
255
node->canSetTag,
256
- @@ -2613 ,7 +2644 ,10 @@ ExecModifyTable(PlanState *pstate)
256
+ @@ -2737 ,7 +2768 ,10 @@ ExecModifyTable(PlanState *pstate)
257
257
* the work on next call.
258
258
*/
259
259
if (slot)
@@ -264,23 +264,23 @@ index d328856ae5..27235ec869 100644
264
264
}
265
265
266
266
/*
267
- @@ -2642 ,6 +2676 ,7 @@ ExecModifyTable(PlanState *pstate)
267
+ @@ -2753 ,6 +2787 ,7 @@ ExecModifyTable(PlanState *pstate)
268
268
269
269
node->mt_done = true;
270
270
271
271
+ estate->es_result_relation_info = saved_resultRelInfo;
272
272
return NULL;
273
273
}
274
274
275
- @@ -2716 ,6 +2751 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
275
+ @@ -2827 ,6 +2862 ,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
276
276
ListCell *l;
277
277
int i;
278
278
Relation rel;
279
279
+ ResultRelInfo *saved_resultRelInfo;
280
280
281
281
/* check for unsupported flags */
282
282
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
283
- @@ -2812 ,6 +2848 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
283
+ @@ -2923 ,6 +2959 ,13 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
284
284
i++;
285
285
}
286
286
@@ -294,8 +294,8 @@ index d328856ae5..27235ec869 100644
294
294
/*
295
295
* Now we may initialize the subplan.
296
296
*/
297
- @@ -2884 ,6 +2927 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
298
- }
297
+ @@ -3004 ,6 +3047 ,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
298
+ ExecInitStoredGenerated(resultRelInfo, estate, operation);
299
299
}
300
300
301
301
+ estate->es_result_relation_info = saved_resultRelInfo;
@@ -304,7 +304,7 @@ index d328856ae5..27235ec869 100644
304
304
* If this is an inherited update/delete, there will be a junk attribute
305
305
* named "tableoid" present in the subplan's targetlist. It will be used
306
306
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
307
- index 381d9e548d..9d101c3a86 100644
307
+ index 381d9e548d..0a4657d291 100644
308
308
--- a/src/backend/utils/init/globals.c
309
309
+++ b/src/backend/utils/init/globals.c
310
310
@@ -25,7 +25,7 @@
@@ -317,7 +317,7 @@ index 381d9e548d..9d101c3a86 100644
317
317
volatile sig_atomic_t InterruptPending = false;
318
318
volatile sig_atomic_t QueryCancelPending = false;
319
319
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
320
- index 134f6862da..92ff475332 100644
320
+ index 5af78bd0dc..0c13bc9d83 100644
321
321
--- a/src/include/access/xact.h
322
322
+++ b/src/include/access/xact.h
323
323
@@ -53,7 +53,9 @@ extern PGDLLIMPORT int XactIsoLevel;
@@ -357,7 +357,7 @@ index 3dc03c913e..1002d97499 100644
357
357
358
358
#endif /* EXECUTOR_H */
359
359
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
360
- index 02015efe13..2091f7f3b7 100644
360
+ index 4acb1cda6e..fd8d38347d 100644
361
361
--- a/src/include/libpq/libpq-be.h
362
362
+++ b/src/include/libpq/libpq-be.h
363
363
@@ -327,7 +327,7 @@ extern ssize_t be_gssapi_read(Port *port, void *ptr, size_t len);
@@ -370,10 +370,10 @@ index 02015efe13..2091f7f3b7 100644
370
370
/* TCP keepalives configuration. These are no-ops on an AF_UNIX socket. */
371
371
372
372
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
373
- index 105180764e..2a40d2ce15 100644
373
+ index ee5ad3c058..dc474819d7 100644
374
374
--- a/src/include/nodes/execnodes.h
375
375
+++ b/src/include/nodes/execnodes.h
376
- @@ -579 ,6 +579 ,12 @@ typedef struct EState
376
+ @@ -592 ,6 +592 ,12 @@ typedef struct EState
377
377
* es_result_relations in no
378
378
* specific order */
379
379
@@ -419,7 +419,7 @@ index de22c9ba2c..c8be5323b8 100644
419
419
420
420
sub CopyIncludeFiles
421
421
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
422
- index 05ff67e693..d169271df1 100644
422
+ index 9b6539fb15..f8a67c6701 100644
423
423
--- a/src/tools/msvc/Mkvcbuild.pm
424
424
+++ b/src/tools/msvc/Mkvcbuild.pm
425
425
@@ -41,7 +41,10 @@ my @contrib_uselibpq =
@@ -434,15 +434,15 @@ index 05ff67e693..d169271df1 100644
434
434
my $contrib_extrasource = {
435
435
'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ],
436
436
'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ],
437
- @@ -970 ,6 +973 ,7 @@ sub AddContrib
437
+ @@ -973 ,6 +976 ,7 @@ sub AddContrib
438
438
my $dn = $1;
439
439
my $proj = $solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n");
440
440
$proj->AddReference($postgres);
441
441
+ $proj->RemoveFile("$subdir/$n/src/declarative.c") if $n eq 'pg_pathman';
442
442
AdjustContribProj($proj);
443
443
}
444
444
elsif ($mf =~ /^MODULES\s*=\s*(.*)$/mg)
445
- @@ -999 ,6 +1003 ,19 @@ sub AddContrib
445
+ @@ -1002 ,6 +1006 ,19 @@ sub AddContrib
446
446
return;
447
447
}
448
448
@@ -462,7 +462,7 @@ index 05ff67e693..d169271df1 100644
462
462
sub GenerateContribSqlFiles
463
463
{
464
464
my $n = shift;
465
- @@ -1023 ,23 +1040 ,53 @@ sub GenerateContribSqlFiles
465
+ @@ -1026 ,23 +1043 ,53 @@ sub GenerateContribSqlFiles
466
466
substr($l, 0, index($l, '$(addsuffix ')) . substr($l, $i + 1);
467
467
}
468
468
0 commit comments