Fix randAccess setting in ReadRecord()
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 28 Jan 2020 10:55:30 +0000 (12:55 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 28 Jan 2020 10:55:30 +0000 (12:55 +0200)
Commit 38a957316d got this backwards.

Author: Kyotaro Horiguchi
Discussion: https://www.postgresql.org/message-id/20200128.194408.2260703306774646445.horikyota.ntt@gmail.com

src/backend/access/transam/xlog.c

index 882d5e8a73fc8e6af7f6d5d36815df48164c5627..6e09ded5974fe26716ef4e32941f2ff407470510 100644 (file)
@@ -4265,7 +4265,7 @@ ReadRecord(XLogReaderState *xlogreader, int emode,
        /* Pass through parameters to XLogPageRead */
        private->fetching_ckpt = fetching_ckpt;
        private->emode = emode;
-       private->randAccess = (xlogreader->ReadRecPtr != InvalidXLogRecPtr);
+       private->randAccess = (xlogreader->ReadRecPtr == InvalidXLogRecPtr);
 
        /* This is the first attempt to read this page. */
        lastSourceFailed = false;