77 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $Id: htup.h,v 1.47 2001/03/22 04:00:27 momjian Exp $
10+ * $Id: htup.h,v 1.48 2001/03/25 22:40:58 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -83,20 +83,27 @@ typedef HeapTupleHeaderData *HeapTupleHeader;
8383
8484/*
8585 * All what we need to find changed tuple (18 bytes)
86+ *
87+ * NB: on most machines, sizeof(xl_heaptid) will include some trailing pad
88+ * bytes for alignment. We don't want to store the pad space in the XLOG,
89+ * so use SizeOfHeapTid for space calculations. Similar comments apply for
90+ * the other xl_FOO structs.
8691 */
8792typedef struct xl_heaptid
8893{
8994 RelFileNode node ;
9095 ItemPointerData tid ; /* changed tuple id */
9196} xl_heaptid ;
9297
98+ #define SizeOfHeapTid (offsetof(xl_heaptid, tid) + SizeOfIptrData)
99+
93100/* This is what we need to know about delete */
94101typedef struct xl_heap_delete
95102{
96103 xl_heaptid target ; /* deleted tuple id */
97104} xl_heap_delete ;
98105
99- #define SizeOfHeapDelete (offsetof(xl_heaptid, tid ) + SizeOfIptrData )
106+ #define SizeOfHeapDelete (offsetof(xl_heap_delete, target ) + SizeOfHeapTid )
100107
101108typedef struct xl_heap_header
102109{
@@ -115,14 +122,14 @@ typedef struct xl_heap_insert
115122 /* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */
116123} xl_heap_insert ;
117124
118- #define SizeOfHeapInsert (offsetof(xl_heaptid, tid ) + SizeOfIptrData )
125+ #define SizeOfHeapInsert (offsetof(xl_heap_insert, target ) + SizeOfHeapTid )
119126
120127/* This is what we need to know about update|move */
121128typedef struct xl_heap_update
122129{
123130 xl_heaptid target ; /* deleted tuple id */
124131 ItemPointerData newtid ; /* new inserted tuple id */
125- /* NEW TUPLE xl_heap_header (XMIN & XMAX FOR MOVE OP) */
132+ /* NEW TUPLE xl_heap_header (PLUS xmax & xmin IF MOVE OP) */
126133 /* and TUPLE DATA FOLLOWS AT END OF STRUCT */
127134} xl_heap_update ;
128135
0 commit comments