Thread: BUG in XLogRecordAssemble
hi,
I found the code in 'backend/access/transam/xloginsert.c' as that:
XLogRecordAssemble:
if (prev_regbuf && RelFileNodeEquals(regbuf->rnode, prev_regbuf->rnode))
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
prev_regbuf = regbuf;
}
else
samerel = false;
There is the only place that prev_regbuf is assigned, so prev_regbuf will never be assigned.
The patch will fix it, Thanks.
Zhang Zq
I found the code in 'backend/access/transam/xloginsert.c' as that:
XLogRecordAssemble:
if (prev_regbuf && RelFileNodeEquals(regbuf->rnode, prev_regbuf->rnode))
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
prev_regbuf = regbuf;
}
else
samerel = false;
There is the only place that prev_regbuf is assigned, so prev_regbuf will never be assigned.
The patch will fix it, Thanks.
Zhang Zq
Attachment
On Tue, May 5, 2015 at 1:04 AM, Zhang Zq <zqzhangmail@163.com> wrote: > There is the only place that prev_regbuf is assigned, so prev_regbuf will > never be assigned. > The patch will fix it, Thanks. Indeed. I think you are right. We never set prev_regbuf with the current code. -- Michael
On 05/04/2015 07:04 PM, Zhang Zq wrote: > hi, > I found the code in 'backend/access/transam/xloginsert.c' as that: > XLogRecordAssemble: > if (prev_regbuf && RelFileNodeEquals(regbuf->rnode, prev_regbuf->rnode)) > { > samerel = true; > bkpb.fork_flags |= BKPBLOCK_SAME_REL; > prev_regbuf = regbuf; > } > else > samerel = false; > > There is the only place that prev_regbuf is assigned, so prev_regbuf will never be assigned. > The patch will fix it, Thanks. Thanks, good catch! Committed. - Heikki