diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/htup.h | 69 | ||||
-rw-r--r-- | src/include/access/xlog.h | 10 | ||||
-rw-r--r-- | src/include/storage/bufpage.h | 6 |
3 files changed, 81 insertions, 4 deletions
diff --git a/src/include/access/htup.h b/src/include/access/htup.h index 784c5051a93..ff514092160 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -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.29 2000/04/12 17:16:26 momjian Exp $ + * $Id: htup.h,v 1.30 2000/06/02 10:20:26 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -44,6 +44,8 @@ typedef struct HeapTupleHeaderData uint8 t_hoff; /* sizeof tuple header */ + /* ^ - 31 bytes - ^ */ + bits8 t_bits[MinHeapTupleBitmapSize / 8]; /* bit map of domains */ @@ -52,6 +54,71 @@ typedef struct HeapTupleHeaderData typedef HeapTupleHeaderData *HeapTupleHeader; + +#ifdef XLOG + +/* XLOG stuff */ + +/* + * XLOG allows to store some information in high 4 bits of log + * record xl_info field + */ +#define XLOG_HEAP_INSERT 0x00 +#define XLOG_HEAP_DELETE 0x10 +#define XLOG_HEAP_UPDATE 0x20 +#define XLOG_HEAP_MOVE 0x30 + +/* + * All what we need to find changed tuple (14 bytes) + */ +typedef struct xl_heaptid +{ + Oid dbId; /* database */ + Oid relId; /* relation */ + ItemPointerData tid; /* changed tuple id */ +} xl_heaptid; + +/* This is what we need to know about delete - ALIGN(14) = 16 bytes */ +typedef struct xl_heap_delete +{ + xl_heaptid dtid; /* deleted tuple id */ +} xl_heap_delete; + +/* This is what we need to know about insert - 22 + data */ +typedef struct xl_heap_insert +{ + xl_heaptid itid; /* inserted tuple id */ + /* something from tuple header */ + int16 t_natts; + Oid t_oid; + uint8 t_hoff; + uint8 mask; /* low 8 bits of t_infomask */ + /* TUPLE DATA FOLLOWS AT END OF STRUCT */ +} xl_heap_insert; + +/* This is what we need to know about update - 28 + data */ +typedef struct xl_heap_update +{ + xl_heaptid dtid; /* deleted tuple id */ + ItemPointerData itid; /* new inserted tuple id */ + /* something from header of new tuple version */ + int16 t_natts; + uint8 t_hoff; + uint8 mask; /* low 8 bits of t_infomask */ + /* NEW TUPLE DATA FOLLOWS AT END OF STRUCT */ +} xl_heap_update; + +/* This is what we need to know about tuple move - ALIGN(20) = 24 bytes */ +typedef struct xl_heap_move +{ + xl_heaptid ftid; /* moved from */ + ItemPointerData ttid; /* moved to */ +} xl_heap_move; + +/* end of XLOG stuff */ + +#endif /* XLOG */ + #define MinTupleSize (MAXALIGN(sizeof (PageHeaderData)) + \ MAXALIGN(sizeof(HeapTupleHeaderData)) + \ MAXALIGN(sizeof(char))) diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index e2ab6e4f417..b5fda0b58ad 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -47,7 +47,12 @@ typedef struct XLogSubRecord #define SizeOfXLogSubRecord DOUBLEALIGN(sizeof(XLogSubRecord)) +/* + * XLOG uses only low 4 bits of xl_info. High 4 bits may be used + * by rmgr... + */ #define XLR_TO_BE_CONTINUED 0x01 +#define XLR_INFO_MASK 0x0F #define XLOG_PAGE_MAGIC 0x17345168 @@ -63,8 +68,9 @@ typedef XLogPageHeaderData *XLogPageHeader; #define XLP_FIRST_IS_SUBRECORD 0x0001 -extern XLogRecPtr XLogInsert(RmgrId rmid, char *hdr, uint32 hdrlen, - char *buf, uint32 buflen); +extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info, + char *hdr, uint32 hdrlen, + char *buf, uint32 buflen); extern void XLogFlush(XLogRecPtr RecPtr); #endif /* XLOG_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index f1c25963951..15d1106f26c 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufpage.h,v 1.28 2000/01/26 05:58:32 momjian Exp $ + * $Id: bufpage.h,v 1.29 2000/06/02 10:20:27 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -117,6 +117,10 @@ typedef OpaqueData *Opaque; */ typedef struct PageHeaderData { +#ifdef XLOG + XLogRecPtr pd_lsn; /* XLOG: next byte after last byte of xlog */ + /* record for last change of this page */ +#endif LocationIndex pd_lower; /* offset to start of free space */ LocationIndex pd_upper; /* offset to end of free space */ LocationIndex pd_special; /* offset to start of special space */ |