Re: Simplify xlogreader.c with XLogRec* macros

2023-11-27 Thread Bharath Rupireddy
On Fri, Nov 3, 2023 at 12:01 AM Bharath Rupireddy wrote: > > On Tue, Oct 31, 2023 at 4:12 PM 邱宇航 wrote: > > > > > > > > I thought these can also be rewrite to: > > > > > > if (!XLogRecHasBlockRef(record, block_id)) > > > > Oops, I missed that. New version is attached. > > +1. Indeed a reasonable

Re: Simplify xlogreader.c with XLogRec* macros

2023-11-02 Thread Bharath Rupireddy
On Tue, Oct 31, 2023 at 4:12 PM 邱宇航 wrote: > > > > > I thought these can also be rewrite to: > > > > if (!XLogRecHasBlockRef(record, block_id)) > > Oops, I missed that. New version is attached. +1. Indeed a reasonable change. The attached v2 patch LGTM. -- Bharath Rupireddy PostgreSQL

Re: Simplify xlogreader.c with XLogRec* macros

2023-10-31 Thread 邱宇航
> @@ -2036,8 +2035,8 @@ RestoreBlockImage(XLogReaderState *record, uint8 > block_id, char *page) > char*ptr; > PGAlignedBlock tmp; > > - if (block_id > record->record->max_block_id || > - !record->record->blocks[block_id].in_use) > + if (block_id > XLogRecMaxBlockId(record) || > +

Re: Simplify xlogreader.c with XLogRec* macros

2023-10-31 Thread Junwang Zhao
On Tue, Oct 31, 2023 at 5:23 PM 邱宇航 wrote: > > Hello hackers, > > Commit 3f1ce97 refactored XLog record access macros, but missed in a few > places. I fixed this, and patch is attached. > > -- > Yuhang Qiu > > > @@ -2036,8 +2035,8 @@ RestoreBlockImage(XLogReaderState *record, uint8 block_id,

Simplify xlogreader.c with XLogRec* macros

2023-10-31 Thread 邱宇航
Hello hackers, Commit 3f1ce97 refactored XLog record access macros, but missed in a few places. I fixed this, and patch is attached. -- Yuhang Qiu 0001-Simplify-xlogreader.c-with-XLogRec-macros.patch Description: Binary data