66 *
77 * Copyright (c) 1994, Regents of the University of California
88 *
9- * $Id: heapam.h,v 1.38 1998/10/08 18:30:22 momjian Exp $
9+ * $Id: heapam.h,v 1.39 1998/11/27 19:33:31 vadim Exp $
1010 *
1111 *-------------------------------------------------------------------------
1212 */
@@ -89,6 +89,10 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
8989 *
9090 * ----------------
9191 */
92+
93+ extern Datum nocachegetattr (HeapTuple tup ,int attnum ,
94+ TupleDesc att ,bool * isnull );
95+
9296#if !defined(DISABLE_COMPLEX_MACRO )
9397
9498#define fastgetattr (tup ,attnum ,tupleDesc ,isnull ) \
@@ -101,7 +105,7 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
101105 (attnum) == 1) ? \
102106( \
103107(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
104- (char *) (tup) + (tup)->t_hoff + \
108+ (char *) (tup)->t_data + (tup)->t_data ->t_hoff + \
105109( \
106110((attnum) != 1) ? \
107111(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
@@ -115,7 +119,7 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
115119) \
116120: \
117121( \
118- att_isnull((attnum)-1, (tup)->t_bits) ? \
122+ att_isnull((attnum)-1, (tup)->t_data-> t_bits) ? \
119123( \
120124((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
121125(Datum)NULL \
@@ -129,9 +133,6 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
129133
130134#else /* !defined(DISABLE_COMPLEX_MACRO) */
131135
132- extern Datum nocachegetattr (HeapTuple tup ,int attnum ,
133- TupleDesc att ,bool * isnull );
134-
135136static Datum
136137fastgetattr (HeapTuple tup ,int attnum ,TupleDesc tupleDesc ,
137138bool * isnull )
@@ -146,7 +147,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
146147 (attnum )== 1 ) ?
147148 (
148149 (Datum )fetchatt (& ((tupleDesc )-> attrs [(attnum )- 1 ]),
149- (char * ) (tup )+ (tup )-> t_hoff +
150+ (char * ) (tup )-> t_data + (tup )-> t_data -> t_hoff +
150151(
151152 ((attnum )!= 1 ) ?
152153(tupleDesc )-> attrs [(attnum )- 1 ]-> attcacheoff
@@ -160,7 +161,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
160161 )
161162 :
162163 (
163- att_isnull ((attnum )- 1 , (tup )-> t_bits ) ?
164+ att_isnull ((attnum )- 1 , (tup )-> t_data -> t_bits ) ?
164165 (
165166 ((isnull ) ? (* (isnull )= true) : (dummyret )NULL ),
166167 (Datum )NULL
@@ -205,7 +206,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
205206AssertMacro((tup) != NULL && \
206207(attnum) > FirstLowInvalidHeapAttributeNumber && \
207208(attnum) != 0), \
208- ((attnum) > (int) (tup)->t_natts) ? \
209+ ((attnum) > (int) (tup)->t_data-> t_natts) ? \
209210( \
210211((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
211212(Datum)NULL \
@@ -221,13 +222,12 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
221222((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
222223((attnum) == SelfItemPointerAttributeNumber) ? \
223224( \
224- (Datum)((char *)(tup) + \
225- heap_sysoffset[-SelfItemPointerAttributeNumber-1]) \
225+ (Datum)((char *)&((tup)->t_self)) \
226226) \
227227: \
228228( \
229229(Datum)*(unsigned int *) \
230- ((char *)(tup) + heap_sysoffset[-(attnum)-1]) \
230+ ((char *)(tup)->t_data + heap_sysoffset[-(attnum)-1]) \
231231) \
232232) \
233233) \
@@ -251,7 +251,7 @@ extern HeapScanDesc heap_beginscan(Relation relation, int atend,
251251extern void heap_rescan (HeapScanDesc scan ,bool scanFromEnd ,ScanKey key );
252252extern void heap_endscan (HeapScanDesc scan );
253253extern HeapTuple heap_getnext (HeapScanDesc scandesc ,int backw );
254- extern HeapTuple heap_fetch (Relation relation ,Snapshot snapshot ,ItemPointer tid ,Buffer * userbuf );
254+ extern void heap_fetch (Relation relation ,Snapshot snapshot ,HeapTuple tup ,Buffer * userbuf );
255255extern Oid heap_insert (Relation relation ,HeapTuple tup );
256256extern int heap_delete (Relation relation ,ItemPointer tid );
257257extern int heap_replace (Relation relation ,ItemPointer otid ,
@@ -270,6 +270,7 @@ extern bool heap_sysattrbyval(AttrNumber attno);
270270extern Datum nocachegetattr (HeapTuple tup ,int attnum ,
271271TupleDesc att ,bool * isnull );
272272extern HeapTuple heap_copytuple (HeapTuple tuple );
273+ extern void heap_copytuple_with_tuple (HeapTuple src ,HeapTuple dest );
273274extern HeapTuple heap_formtuple (TupleDesc tupleDescriptor ,
274275Datum * value ,char * nulls );
275276extern HeapTuple heap_modifytuple (HeapTuple tuple ,