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

Commitd2965f6

Browse files
committed
Introduce XLogRecPtrIsValid()
XLogRecPtrIsInvalid() is inconsistent with the affirmative form ofmacros used for other datatypes, and leads to awkward double negativesin a few places. This commit introduces XLogRecPtrIsValid(), whichallows code to be written more naturally.This patch only adds the new macro. XLogRecPtrIsInvalid() is left inplace, and all existing callers remain untouched. This means allsupported branches can accept hypothetical bug fixes that use the newmacro, and at the same time any code that compiled with the originalformulation will continue to silently compile just fine.Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Backpatch-through: 13Discussion:https://postgr.es/m/aQB7EvGqrbZXrMlg@ip-10-97-1-34.eu-west-3.compute.internal
1 parentccfe28e commitd2965f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/include/access/xlogdefs.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ typedef uint64 XLogRecPtr;
2525
* WAL segment, initializing the first WAL page at WAL segment size, so no XLOG
2626
* record can begin at zero.
2727
*/
28-
#defineInvalidXLogRecPtr0
28+
#defineInvalidXLogRecPtr0
29+
#defineXLogRecPtrIsValid(r)((r) != InvalidXLogRecPtr)
2930
#defineXLogRecPtrIsInvalid(r)((r) == InvalidXLogRecPtr)
3031

3132
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp