GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere. - Mailing list pgsql-hackers

From Amul Sul
Subject GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere.
Date
Msg-id CAAJ_b945_0L4rMsQeE4h0ArHJMc+ASJJs_h3jXdas5eTtNqowg@mail.gmail.com
Whole thread Raw
Responses Re: GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere.
Re: GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere.
List pgsql-hackers
Hi,

If you look at GetFlushRecPtr() function the OUT parameter for
TimeLineID is optional and this is not only one, see
GetWalRcvFlushRecPtr(), GetXLogReplayRecPtr(), etc.

I think we have missed that for GetStandbyFlushRecPtr(), to be
inlined, we should change this as follow:

--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -3156,7 +3156,8 @@ GetStandbyFlushRecPtr(TimeLineID *tli)
    receivePtr = GetWalRcvFlushRecPtr(NULL, &receiveTLI);
    replayPtr = GetXLogReplayRecPtr(&replayTLI);

-   *tli = replayTLI;
+   if (tli)
+       *tli = replayTLI;

Thoughts?
--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger
Next
From: Dilip Kumar
Date:
Subject: Re: making relfilenodes 56 bits