fix1.diff
text/x-patch
Filename: fix1.diff
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/backend/access/heap/heapam.c | 19 | 0 |
*** a/src/backend/access/heap/heapam.c
--- b/src/backend/access/heap/heapam.c
***************
*** 4079,4086 **** log_newpage(RelFileNode *rnode, ForkNumber forkNum, BlockNumber blkno,
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_NEWPAGE, rdata);
! PageSetLSN(page, recptr);
! PageSetTLI(page, ThisTimeLineID);
END_CRIT_SECTION();
--- 4079,4093 ----
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_NEWPAGE, rdata);
! /*
! * The new page may be uninitialized. If so, we can't set the LSN
! * and TLI because that would corrupt the page.
! */
! if (!PageIsNew(page))
! {
! PageSetLSN(page, recptr);
! PageSetTLI(page, ThisTimeLineID);
! }
END_CRIT_SECTION();
***************
*** 4266,4273 **** heap_xlog_newpage(XLogRecPtr lsn, XLogRecord *record)
Assert(record->xl_len == SizeOfHeapNewpage + BLCKSZ);
memcpy(page, (char *) xlrec + SizeOfHeapNewpage, BLCKSZ);
! PageSetLSN(page, lsn);
! PageSetTLI(page, ThisTimeLineID);
MarkBufferDirty(buffer);
UnlockReleaseBuffer(buffer);
}
--- 4273,4288 ----
Assert(record->xl_len == SizeOfHeapNewpage + BLCKSZ);
memcpy(page, (char *) xlrec + SizeOfHeapNewpage, BLCKSZ);
! /*
! * The new page may be uninitialized. If so, we can't set the LSN
! * and TLI because that would corrupt the page.
! */
! if (!PageIsNew(page))
! {
! PageSetLSN(page, lsn);
! PageSetTLI(page, ThisTimeLineID);
! }
!
MarkBufferDirty(buffer);
UnlockReleaseBuffer(buffer);
}