diff options
author | Bruce Momjian <bruce@momjian.us> | 1997-08-26 23:31:58 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1997-08-26 23:31:58 +0000 |
commit | 75c6c2b6082604dcc8732dd99eeb286ea37173bd (patch) | |
tree | 58527f581e490113415de5acec5f485c600631e7 /src/backend/access/common/heaptuple.c | |
parent | 20afa04d03b1d1f58a926d3d183ff792a12073da (diff) | |
download | postgresql-75c6c2b6082604dcc8732dd99eeb286ea37173bd.tar.gz postgresql-75c6c2b6082604dcc8732dd99eeb286ea37173bd.zip |
Inlined heap_getattr().
Diffstat (limited to 'src/backend/access/common/heaptuple.c')
-rw-r--r-- | src/backend/access/common/heaptuple.c | 65 |
1 files changed, 6 insertions, 59 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index 30961f4f549..60ec3e4d3ab 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.20 1997/08/24 23:07:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.21 1997/08/26 23:31:20 momjian Exp $ * * NOTES * The old interface functions have been converted to macros @@ -39,8 +39,6 @@ #define register #endif /* !NO_ASSERT_CHECKING && sparc && sunos4 */ -static char *heap_getsysattr(HeapTuple tup, Buffer b, int attnum); - /* ---------------------------------------------------------------- * misc support routines * ---------------------------------------------------------------- @@ -337,7 +335,7 @@ heap_sysattrbyval(AttrNumber attno) * heap_getsysattr * ---------------- */ -static char * +char * heap_getsysattr(HeapTuple tup, Buffer b, int attnum) { switch (attnum) { @@ -423,7 +421,6 @@ fastgetattr(HeapTuple tup, * ---------------- */ - Assert(PointerIsValid(isnull)); Assert(attnum > 0); /* ---------------- @@ -435,7 +432,8 @@ fastgetattr(HeapTuple tup, * ---------------- */ - *isnull = false; + if (isnull) + *isnull = false; if (HeapTupleNoNulls(tup)) { attnum--; @@ -469,7 +467,8 @@ fastgetattr(HeapTuple tup, */ if (att_isnull(attnum, bp)) { - *isnull = true; + if (isnull) + *isnull = true; return NULL; } @@ -660,58 +659,6 @@ fastgetattr(HeapTuple tup, } /* ---------------- - * heap_getattr - * - * Find a particular field in a row represented as a heap tuple. - * We return a pointer into that heap tuple, which points to the - * first byte of the value of the field in question. - * - * If the field in question has a NULL value, we return a null - * pointer and return <*isnull> == true. Otherwise, we return - * <*isnull> == false. - * - * <tup> is the pointer to the heap tuple. <attnum> is the attribute - * number of the column (field) caller wants. <tupleDesc> is a - * pointer to the structure describing the row and all its fields. - * ---------------- */ -char * -heap_getattr(HeapTuple tup, - Buffer b, - int attnum, - TupleDesc tupleDesc, - bool *isnull) -{ - bool localIsNull; - - /* ---------------- - * sanity checks - * ---------------- - */ - Assert(tup != NULL); - - if (! PointerIsValid(isnull)) - isnull = &localIsNull; - - if (attnum > (int) tup->t_natts) { - *isnull = true; - return ((char *) NULL); - } else if (attnum > 0) { - /* ---------------- - * take care of user defined attributes - * ---------------- - */ - return fastgetattr(tup, attnum, tupleDesc, isnull); - } else { - /* ---------------- - * take care of system attributes - * ---------------- - */ - *isnull = false; - return heap_getsysattr(tup, b, attnum); - } -} - -/* ---------------- * heap_copytuple * * returns a copy of an entire tuple |