|
6 | 6 | *
|
7 | 7 | * Copyright (c) 1994, Regents of the University of California
|
8 | 8 | *
|
9 |
| - * $Id: heapam.h,v 1.7 1997/08/19 21:37:30 momjian Exp $ |
| 9 | + * $Id: heapam.h,v 1.8 1997/08/26 23:31:53 momjian Exp $ |
10 | 10 | *
|
11 | 11 | *-------------------------------------------------------------------------
|
12 | 12 | */
|
@@ -78,6 +78,30 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
|
78 | 78 | #defineIncrHeapAccessStat(x) \
|
79 | 79 | (heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
|
80 | 80 |
|
| 81 | +/* ---------------- |
| 82 | + * heap_getattr |
| 83 | + * |
| 84 | + * Find a particular field in a row represented as a heap tuple. |
| 85 | + * We return a pointer into that heap tuple, which points to the |
| 86 | + * first byte of the value of the field in question. |
| 87 | + * |
| 88 | + * If the field in question has a NULL value, we return a null |
| 89 | + * pointer and return <*isnull> == true. Otherwise, we return |
| 90 | + * <*isnull> == false. |
| 91 | + * |
| 92 | + * <tup> is the pointer to the heap tuple. <attnum> is the attribute |
| 93 | + * number of the column (field) caller wants. <tupleDesc> is a |
| 94 | + * pointer to the structure describing the row and all its fields. |
| 95 | + * ---------------- */ |
| 96 | +#defineheap_getattr(tup,b,attnum,tupleDesc,isnull) \ |
| 97 | + (AssertMacro((tup) != NULL) ? \ |
| 98 | +((attnum) > (int) (tup)->t_natts) ? \ |
| 99 | + (((isnull) ? (*(isnull) = true) : NULL), (char *) NULL) : \ |
| 100 | +((attnum) > 0) ? \ |
| 101 | + fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \ |
| 102 | +(((isnull) ? (*(isnull) = false) : NULL), heap_getsysattr((tup), (b), (attnum))) : \ |
| 103 | + (char *) NULL) |
| 104 | + |
81 | 105 | externHeapAccessStatisticsheap_access_stats;/* in stats.c */
|
82 | 106 |
|
83 | 107 | /* ----------------
|
@@ -114,10 +138,9 @@ extern void DataFill(char *data, TupleDesc tupleDesc,
|
114 | 138 | externintheap_attisnull(HeapTupletup,intattnum);
|
115 | 139 | externintheap_sysattrlen(AttrNumberattno);
|
116 | 140 | externboolheap_sysattrbyval(AttrNumberattno);
|
| 141 | +externchar*heap_getsysattr(HeapTupletup,Bufferb,intattnum); |
117 | 142 | externchar*fastgetattr(HeapTupletup,intattnum,
|
118 | 143 | TupleDescatt,bool*isnull);
|
119 |
| -externchar*heap_getattr(HeapTupletup,Bufferb,intattnum, |
120 |
| -TupleDescatt,bool*isnull); |
121 | 144 | externHeapTupleheap_copytuple(HeapTupletuple);
|
122 | 145 | externHeapTupleheap_formtuple(TupleDesctupleDescriptor,
|
123 | 146 | Datumvalue[],charnulls[]);
|
|