diff options
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r-- | src/include/access/heapam.h | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index ab30f09b308..c716ab23926 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.54 2000/06/30 16:10:49 petere Exp $ + * $Id: heapam.h,v 1.55 2000/07/02 22:01:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -165,36 +165,41 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, * * ---------------- */ -#define heap_getattr(tup, attnum, tupleDesc, isnull) \ -( \ - AssertMacro((tup) != NULL && \ - (attnum) > FirstLowInvalidHeapAttributeNumber && \ - (attnum) != 0), \ - ((attnum) > (int) (tup)->t_data->t_natts) ? \ - ( \ - ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \ - (Datum)NULL \ - ) \ - : \ - ( \ - ((attnum) > 0) ? \ - ( \ - fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \ - ) \ - : \ - ( \ - ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \ - ((attnum) == SelfItemPointerAttributeNumber) ? \ - ( \ - (Datum)((char *)&((tup)->t_self)) \ - ) \ - : \ - ( \ - (Datum)*(unsigned int *) \ - ((char *)(tup)->t_data + heap_sysoffset[-(attnum)-1]) \ - ) \ - ) \ - ) \ +#define heap_getattr(tup, attnum, tupleDesc, isnull) \ +( \ + AssertMacro((tup) != NULL && \ + (attnum) > FirstLowInvalidHeapAttributeNumber && \ + (attnum) != 0), \ + ((attnum) > (int) (tup)->t_data->t_natts) ? \ + ( \ + ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \ + (Datum)NULL \ + ) \ + : \ + ( \ + ((attnum) > 0) ? \ + ( \ + fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \ + ) \ + : \ + ( \ + ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \ + ((attnum) == SelfItemPointerAttributeNumber) ? \ + ( \ + (Datum)((char *)&((tup)->t_self)) \ + ) \ + : \ + (((attnum) == TableOidAttributeNumber) ? \ + ( \ + (Datum)((tup)->tableOid) \ + ) \ + : \ + ( \ + (Datum)*(unsigned int *) \ + ((char *)(tup)->t_data + heap_sysoffset[-(attnum)-1]) \ + )) \ + ) \ + ) \ ) extern HeapAccessStatistics heap_access_stats; /* in stats.c */ |