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

Commit362de94

Browse files
committed
Remove field UpdateContext->updated in nodeModifyTable.c
This field has been redundant ever since it was added by commit25e777c, which split up ExecUpdate() and ExecDelete() into reusablepieces. The only place that reads it is ExecMergeMatched(), if theresult from ExecUpdateAct() is TM_Ok. However, all paths throughExecUpdateAct() that return TM_Ok also set this field to true, so thereturn status by itself is sufficient to tell if the update happened.Removing this field is a modest simplification, and it brings theUPDATE path in ExecMergeMatched() more into line with ExecUpdate(),ensuring that ExecUpdateEpilogue() is always called if ExecUpdateAct()returns TM_Ok, reducing the chance of bugs.Dean Rasheed, reviewed by Alvaro Herrera.Discussion:https://postgr.es/m/CAEZATCWGGmigGBzLHkJm5Ccv2mMxXmwi3%2Buq0yhwDHm-tsvSLg%40mail.gmail.com
1 parent6fd144e commit362de94

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎src/backend/executor/nodeModifyTable.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ typedef struct ModifyTableContext
109109
*/
110110
typedefstructUpdateContext
111111
{
112-
boolupdated;/* did UPDATE actually occur? */
113112
boolcrossPartUpdate;/* was it a cross-partition update? */
114113
TU_UpdateIndexesupdateIndexes;/* Which index updates are required? */
115114

@@ -2042,7 +2041,6 @@ ExecUpdateAct(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
20422041
&insert_destrel))
20432042
{
20442043
/* success! */
2045-
updateCxt->updated= true;
20462044
updateCxt->crossPartUpdate= true;
20472045

20482046
/*
@@ -2111,8 +2109,6 @@ ExecUpdateAct(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
21112109
true/* wait for commit */ ,
21122110
&context->tmfd,&updateCxt->lockmode,
21132111
&updateCxt->updateIndexes);
2114-
if (result==TM_Ok)
2115-
updateCxt->updated= true;
21162112

21172113
returnresult;
21182114
}
@@ -2919,7 +2915,7 @@ ExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
29192915
return true;
29202916
}
29212917

2922-
if (result==TM_Ok&&updateCxt.updated)
2918+
if (result==TM_Ok)
29232919
{
29242920
ExecUpdateEpilogue(context,&updateCxt,resultRelInfo,
29252921
tupleid,NULL,newslot);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp