Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66ecdcc

Browse files
committed
Use InvalidXLogRecPtr rather than zero literal
This makes the code a bit close to PostgreSQL's style.
1 parent d26a71f commit 66ecdcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/pg_tde/src/access/pg_tde_xlog_smgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ tdeheap_xlog_seg_read(int fd, void *buf, size_t count, off_t offset,
278278
if (!keys)
279279
{
280280
/* cache is empty, try to read keys from disk */
281-
keys = pg_tde_fetch_wal_keys(0);
281+
keys = pg_tde_fetch_wal_keys(InvalidXLogRecPtr);
282282
}
283283

284284
#ifndef FRONTEND
285285
write_key_lsn = pg_atomic_read_u64(&EncryptionState->enc_key_lsn);
286286

287-
if (write_key_lsn != 0)
287+
if (!XLogRecPtrIsInvalid(write_key_lsn))
288288
{
289289
WALKeyCacheRec *last_key = pg_tde_get_last_wal_key();
290290

0 commit comments

Comments
 (0)