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

Commitefa70c1

Browse files
committed
Make GetSlotInvalidationCause() return RS_INVAL_NONE on unexpected input
943f7ae has changed GetSlotInvalidationCause() so as it wouldreturn the last element of SlotInvalidationCauses[] when an incorrectconflict reason name is given by a caller, but this should returnRS_INVAL_NONE in such cases, even if such a state should never bereached in practice.Per gripe from Peter Smith.Reviewed-by: Bharath RupireddyDiscussion:https://postgr.es/m/CAHut+PtsrSWxczpGkSaSVtJo+BXrvJ3Hwp5gES14bbL-G+HL7A@mail.gmail.com
1 parent93db6cb commitefa70c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/replication/slot.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,6 +2327,7 @@ ReplicationSlotInvalidationCause
23272327
GetSlotInvalidationCause(constchar*conflict_reason)
23282328
{
23292329
ReplicationSlotInvalidationCausecause;
2330+
ReplicationSlotInvalidationCauseresult=RS_INVAL_NONE;
23302331
boolfoundPG_USED_FOR_ASSERTS_ONLY= false;
23312332

23322333
Assert(conflict_reason);
@@ -2336,10 +2337,11 @@ GetSlotInvalidationCause(const char *conflict_reason)
23362337
if (strcmp(SlotInvalidationCauses[cause],conflict_reason)==0)
23372338
{
23382339
found= true;
2340+
result=cause;
23392341
break;
23402342
}
23412343
}
23422344

23432345
Assert(found);
2344-
returncause;
2346+
returnresult;
23452347
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp