Re: Simplify xlogreader.c with XLogRec* macros - Mailing list pgsql-hackers

From 邱宇航
Subject Re: Simplify xlogreader.c with XLogRec* macros
Date
Msg-id A363791D-DC5E-40D9-8A70-0B246125255C@gmail.com
Whole thread Raw
In response to Re: Simplify xlogreader.c with XLogRec* macros  (Junwang Zhao <zhjwpku@gmail.com>)
Responses Re: Simplify xlogreader.c with XLogRec* macros
List pgsql-hackers
> @@ -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) ||
> + !XLogRecGetBlock(record, block_id)->in_use)
> 
> I thought these can also be rewrite to:
> 
> if (!XLogRecHasBlockRef(record, block_id))

Oops, I missed that. New version is attached.

--
Yuhang Qiu


Attachment

pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Trigger violates foreign key constraint
Next
From: Amit Kapila
Date:
Subject: Re: Synchronizing slots from primary to standby