mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
misc
This commit is contained in:
parent
e1a118e5e6
commit
d0273c07ac
@ -6,7 +6,7 @@
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1402,7 +1402,7 @@ StartupXLOG()
|
||||
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)",
|
||||
|
@ -7,7 +7,7 @@
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -87,6 +87,8 @@ typedef struct xl_heap_delete
|
||||
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
|
||||
{
|
||||
@ -99,6 +101,8 @@ 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
|
||||
{
|
||||
@ -111,6 +115,8 @@ 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
|
||||
{
|
||||
@ -118,6 +124,8 @@ 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 */
|
||||
|
@ -13,8 +13,8 @@ typedef uint8 RmgrId;
|
||||
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;
|
||||
@ -24,11 +24,12 @@ 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 */
|
||||
|
@ -22,7 +22,7 @@ typedef struct XLogRecord
|
||||
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 */
|
||||
|
||||
@ -32,6 +32,10 @@ typedef struct XLogRecord
|
||||
|
||||
#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.
|
||||
|
@ -7,7 +7,7 @@
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -30,6 +30,9 @@ typedef struct ItemPointerData
|
||||
OffsetNumber ip_posid;
|
||||
} ItemPointerData;
|
||||
|
||||
#define SizeOfIptrData \
|
||||
(offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber))
|
||||
|
||||
typedef ItemPointerData *ItemPointer;
|
||||
|
||||
/* ----------------
|
||||
|
Loading…
Reference in New Issue
Block a user