]> granicus.if.org Git - postgresql/commitdiff
Fix the same-rel optimization when creating WAL records.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 May 2015 17:58:42 +0000 (20:58 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 May 2015 18:03:36 +0000 (21:03 +0300)
prev_regbuf was never set, and therefore the same-rel flag was never set on
WAL records.

Report and fix by Zhanq Zq

src/backend/access/transam/xloginsert.c

index 0cdb6af052d0777a634dc7dc493c5e072c933606..419736da3103ddc65aaf09ed614a90a7ed1fd307 100644 (file)
@@ -667,10 +667,10 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
                {
                        samerel = true;
                        bkpb.fork_flags |= BKPBLOCK_SAME_REL;
-                       prev_regbuf = regbuf;
                }
                else
                        samerel = false;
+               prev_regbuf = regbuf;
 
                /* Ok, copy the header to the scratch buffer */
                memcpy(scratch, &bkpb, SizeOfXLogRecordBlockHeader);