Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

2021-04-23 Thread Michael Paquier
On Fri, Apr 23, 2021 at 02:18:10PM +0900, Kyotaro Horiguchi wrote:
> AFAICS it fixes the all remaining LSN parameters.

Thanks for double-checking.  I was not sure if I got all of them or
not.  Applied that now as of 4aba61b.
--
Michael


signature.asc
Description: PGP signature


Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

2021-04-22 Thread Kyotaro Horiguchi
At Fri, 23 Apr 2021 13:54:15 +0900, Michael Paquier  wrote 
in 
> Hi all,
> 
> As $subject says, I noticed that while scanning the area.  Any
> objections to make all that more consistent with the style of HEAD?
> Please see the attached.

AFAICS it fixes the all remaining LSN parameters.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center




Re: Forgot some LSN_FORMAT_ARGS() in xlogreader.c

2021-04-22 Thread Tom Lane
Michael Paquier  writes:
> As $subject says, I noticed that while scanning the area.  Any
> objections to make all that more consistent with the style of HEAD?
> Please see the attached.

+1, it's not surprising some places didn't get that memo yet.

regards, tom lane




Forgot some LSN_FORMAT_ARGS() in xlogreader.c

2021-04-22 Thread Michael Paquier
Hi all,

As $subject says, I noticed that while scanning the area.  Any
objections to make all that more consistent with the style of HEAD?
Please see the attached.
--
Michael
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 3ae4127b8a..c0e7c3707d 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -754,8 +754,7 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 	targetRecOff == pageHeaderSize)
 {
 	report_invalid_record(state, "contrecord is requested by %X/%X",
-		  (uint32) (state->DecodeRecPtr >> 32),
-		  (uint32) state->DecodeRecPtr);
+		  LSN_FORMAT_ARGS(state->DecodeRecPtr));
 	goto err;
 }
 
@@ -965,13 +964,10 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 	pageHeader = (XLogPageHeader) state->readBuf;
 	if (!(pageHeader->xlp_info & XLP_FIRST_IS_CONTRECORD))
 	{
-		report_invalid_record(
-			  state,
+		report_invalid_record(state,
 			  "there is no contrecord flag at %X/%X reading %X/%X",
-			  (uint32) (state->recordContRecPtr >> 32),
-			  (uint32) state->recordContRecPtr,
-			  (uint32) (state->DecodeRecPtr >> 32),
-			  (uint32) state->DecodeRecPtr);
+			  LSN_FORMAT_ARGS(state->recordContRecPtr),
+			  LSN_FORMAT_ARGS(state->DecodeRecPtr));
 		goto err;
 	}
 
@@ -986,10 +982,8 @@ XLogDecodeOneRecord(XLogReaderState *state, bool allow_oversized)
 			  state,
 			  "invalid contrecord length %u at %X/%X reading %X/%X, expected %u",
 			  pageHeader->xlp_rem_len,
-			  (uint32) (state->recordContRecPtr >> 32),
-			  (uint32) state->recordContRecPtr,
-			  (uint32) (state->DecodeRecPtr >> 32),
-			  (uint32) state->DecodeRecPtr,
+			  LSN_FORMAT_ARGS(state->recordContRecPtr),
+			  LSN_FORMAT_ARGS(state->DecodeRecPtr),
 			  state->recordRemainLen);
 		goto err;
 	}


signature.asc
Description: PGP signature