* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.16 2000/06/02 15:57:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.17 2000/07/04 01:49:43 vadim Exp $
*
*-------------------------------------------------------------------------
*/
record = ReadRecord(&RecPtr, buffer);
if (TransactionIdIsValid(record->xl_xid) &&
!TransactionIdDidCommit(record->xl_xid))
- RmgrTable[record->xl_rmid].rm_undo(record);
+ RmgrTable[record->xl_rmid].rm_undo(EndRecPtr, record);
RecPtr = record->xl_prev;
} while (XLByteLE(checkPoint.undo, RecPtr));
elog(LOG, "Undo done at (%u, %u)",
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: htup.h,v 1.32 2000/07/03 02:54:17 vadim Exp $
+ * $Id: htup.h,v 1.33 2000/07/04 01:49:43 vadim Exp $
*
*-------------------------------------------------------------------------
*/
xl_heaptid dtid; /* deleted tuple id */
} xl_heap_delete;
+#define SizeOfHeapDelete (offsetof(xl_heaptid, tid) + SizeOfIptrData))
+
/* This is what we need to know about insert - 26 + data */
typedef struct xl_heap_insert
{
/* TUPLE DATA FOLLOWS AT END OF STRUCT */
} xl_heap_insert;
+#define SizeOfHeapInsert (offsetof(xl_heap_insert, mask) + sizeof(uint8))
+
/* This is what we need to know about update - 28 + data */
typedef struct xl_heap_update
{
/* NEW TUPLE DATA FOLLOWS AT END OF STRUCT */
} xl_heap_update;
+#define SizeOfHeapUpdate (offsetof(xl_heap_update, mask) + sizeof(uint8))
+
/* This is what we need to know about tuple move - 24 bytes */
typedef struct xl_heap_move
{
ItemPointerData ttid; /* moved to */
} xl_heap_move;
+#define SizeOfHeapMove (offsetof(xl_heap_move, ttid) + SizeOfIptrData))
+
/* end of XLOG stuff */
#endif /* XLOG */
typedef struct RmgrData
{
char *rm_name;
- char *(*rm_redo) (); /* REDO(XLogRecPtr rptr) */
- char *(*rm_undo) (); /* UNDO(XLogRecPtr rptr) */
+ void (*rm_redo)(); /* REDO(XLogRecPtr lsn, XLogRecord rptr) */
+ void (*rm_undo)(); /* UNDO(XLogRecPtr lsn, XLogRecord rptr) */
} RmgrData;
extern RmgrData *RmgrTable;
*/
#define RM_XLOG_ID 0
#define RM_XACT_ID 1
-#define RM_HEAP_ID 2
-#define RM_BTREE_ID 3
-#define RM_HASH_ID 4
-#define RM_RTREE_ID 5
-#define RM_GIST_ID 6
+#define RM_SMGR_ID 2
+#define RM_HEAP_ID 10
+#define RM_BTREE_ID 11
+#define RM_HASH_ID 12
+#define RM_RTREE_ID 13
+#define RM_GIST_ID 14
#define RM_MAX_ID RM_GIST_ID
#endif /* RMGR_H */
XLogRecPtr xl_prev; /* ptr to previous record in log */
XLogRecPtr xl_xact_prev; /* ptr to previous record of this xact */
TransactionId xl_xid; /* xact id */
- uint16 xl_len; /* len of record on this page */
+ uint16 xl_len; /* len of record *data* on this page */
uint8 xl_info;
RmgrId xl_rmid; /* resource manager inserted this record */
#define SizeOfXLogRecord DOUBLEALIGN(sizeof(XLogRecord))
#define MAXLOGRECSZ (2 * BLCKSZ)
+
+#define XLogRecGetData(record) \
+ ((char*)record + SizeOfXLogRecord)
+
/*
* When there is no space on current page we continue on the next
* page with subrecord.
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: itemptr.h,v 1.14 2000/01/26 05:58:33 momjian Exp $
+ * $Id: itemptr.h,v 1.15 2000/07/04 01:49:44 vadim Exp $
*
*-------------------------------------------------------------------------
*/
OffsetNumber ip_posid;
} ItemPointerData;
+#define SizeOfIptrData \
+ (offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber))
+
typedef ItemPointerData *ItemPointer;
/* ----------------