calls.
-/*-------------------------------------------------------------------------
+ /*-------------------------------------------------------------------------
*
* heaptuple.c--
* This file contains heap tuple accessor and mutator routines, as well
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.30 1998/01/07 21:00:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.31 1998/01/31 04:38:02 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
#include
#endif
+/* Used by heap_getattr() macro, for speed */
+long heap_sysoffset[] = {
+/* Only the first one is pass-by-ref, and is handled specially in the macro */
+ offsetof(HeapTupleData, t_ctid),
+ offsetof(HeapTupleData, t_oid),
+ offsetof(HeapTupleData, t_xmin),
+ offsetof(HeapTupleData, t_cmin),
+ offsetof(HeapTupleData, t_xmax),
+ offsetof(HeapTupleData, t_cmax)
+};
/* this is so the sparcstation debugger works */
{
switch (attnum)
{
- case SelfItemPointerAttributeNumber:
+ case SelfItemPointerAttributeNumber:
return ((Datum) &tup->t_ctid);
case ObjectIdAttributeNumber:
return ((Datum) (long) tup->t_oid);
}
/* ----------------
- * fastgetattr
+ * nocachegetattr
+ *
+ * This only gets called from fastgetattr() macro, in cases where
+ * we can't use a cacheoffset and the value is not null.
*
- * This is a newer version of fastgetattr which attempts to be
- * faster by caching attribute offsets in the attribute descriptor.
+ * This caches attribute offsets in the attribute descriptor.
*
* an alternate way to speed things up would be to cache offsets
* with the tuple, but that seems more difficult unless you take
* ----------------
*/
Datum
-fastgetattr(HeapTuple tup,
+nocachegetattr(HeapTuple tup,
int attnum,
TupleDesc tupleDesc,
bool *isnull)
int slow; /* do we have to walk nulls? */
AttributeTupleForm *att = tupleDesc->attrs;
- /* ----------------
- * sanity checks
- * ----------------
- */
-
+
+#if IN_MACRO
+/* This is handled in the macro */
Assert(attnum > 0);
+ if (isnull)
+ *isnull = false;
+#endif
+
/* ----------------
* Three cases:
*
* ----------------
*/
- if (isnull)
- *isnull = false;
-
if (HeapTupleNoNulls(tup))
{
attnum--;
+
+#if IN_MACRO
+/* This is handled in the macro */
if (att[attnum]->attcacheoff > 0)
{
return (Datum)
*/
return ((Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
}
+#endif
tp = (char *) tup + tup->t_hoff;
* ----------------
*/
+#if IN_MACRO
+/* This is handled in the macro */
if (att_isnull(attnum, bp))
{
if (isnull)
*isnull = true;
return (Datum) NULL;
}
+#endif
/* ----------------
* Now check to see if any preceeding bits are null...
if (att[j]->attlen < sizeof(int32))
{
elog(ERROR,
- "fastgetattr: attribute %d has len %d",
+ "nocachegetattr: attribute %d has len %d",
j, att[j]->attlen);
}
if (att[j]->attalign == 'd')
default:
if (att[i]->attlen < sizeof(int32))
elog(ERROR,
- "fastgetattr2: attribute %d has len %d",
+ "nocachegetattr2: attribute %d has len %d",
i, att[i]->attlen);
if (att[i]->attalign == 'd')
off = DOUBLEALIGN(off);
break;
default:
if (att[attnum]->attlen < sizeof(int32))
- elog(ERROR, "fastgetattr3: attribute %d has len %d",
+ elog(ERROR, "nocachegetattr3: attribute %d has len %d",
attnum, att[attnum]->attlen);
if (att[attnum]->attalign == 'd')
off = DOUBLEALIGN(off);
bool isnull;
values[i] = heap_getattr(tuple,
- InvalidBuffer,
i + 1,
tdesc,
&isnull);
{
value[attoff] =
heap_getattr(tuple,
- InvalidBuffer,
AttrOffsetGetAttrNumber(attoff),
RelationGetTupleDescriptor(relation),
&isNull);
return (tup);
}
+
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.22 1998/01/07 21:00:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.23 1998/01/31 04:38:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include
#endif
-static Size IndexInfoFindDataOffset(unsigned short t_info);
-static char *
-fastgetiattr(IndexTuple tup, int attnum,
- TupleDesc att, bool *isnull);
-
/* ----------------------------------------------------------------
* index_ tuple interface routines
* ----------------------------------------------------------------
}
/* ----------------
- * fastgetiattr
+ * nocache_index_getattr
+ *
+ * This gets called from index_getattr() macro, and only in cases
+ * where we can't use cacheoffset and the value is not null.
*
- * This is a newer version of fastgetiattr which attempts to be
- * faster by caching attribute offsets in the attribute descriptor.
+ * This caches attribute offsets in the attribute descriptor.
*
* an alternate way to speed things up would be to cache offsets
* with the tuple, but that seems more difficult unless you take
* the same attribute descriptor will go much quicker. -cim 5/4/91
* ----------------
*/
-static char *
-fastgetiattr(IndexTuple tup,
+Datum
+nocache_index_getattr(IndexTuple tup,
int attnum,
TupleDesc tupleDesc,
bool *isnull)
* ----------------
*/
- Assert(PointerIsValid(isnull));
- Assert(attnum > 0);
-
/* ----------------
* Three cases:
*
* ----------------
*/
+#ifdef IN_MACRO
+/* This is handled in the macro */
+ Assert(PointerIsValid(isnull));
+ Assert(attnum > 0);
+
*isnull = false;
+#endif
+
data_off = IndexTupleHasMinHeader(tup) ? sizeof *tup :
IndexInfoFindDataOffset(tup->t_info);
if (IndexTupleNoNulls(tup))
{
+ attnum--;
+#ifdef IN_MACRO
+/* This is handled in the macro */
+
/* first attribute is always at position zero */
if (attnum == 1)
{
- return (fetchatt(&(att[0]), (char *) tup + data_off));
+ return (Datum) fetchatt(&(att[0]), (char *) tup + data_off);
}
- attnum--;
-
if (att[attnum]->attcacheoff > 0)
{
- return (fetchatt(&(att[attnum]),
+ return (Datum) fetchatt(&(att[attnum]),
(char *) tup + data_off +
- att[attnum]->attcacheoff));
+ att[attnum]->attcacheoff);
}
+#endif
tp = (char *) tup + data_off;
else
{ /* there's a null somewhere in the tuple */
- bp = (char *) tup + sizeof(*tup); /* "knows" t_bits are
- * here! */
slow = 0;
/* ----------------
* check to see if desired att is null
*/
attnum--;
+
+ bp = (char *) tup + sizeof(*tup); /* "knows" t_bits are
+ * here! */
+#ifdef IN_MACRO
+/* This is handled in the macro */
+
+ if (att_isnull(attnum, bp))
{
- if (att_isnull(attnum, bp))
- {
- *isnull = true;
- return NULL;
- }
+ *isnull = true;
+ return (Datum)NULL;
}
+#endif
+
/* ----------------
* Now check to see if any preceeding bits are null...
* ----------------
{
if (att[attnum]->attcacheoff > 0)
{
- return (fetchatt(&(att[attnum]),
- tp + att[attnum]->attcacheoff));
+ return (Datum) fetchatt(&(att[attnum]),
+ tp + att[attnum]->attcacheoff);
}
else if (!IndexTupleAllFixed(tup))
{
off = (att[j]->attalign == 'd') ?
DOUBLEALIGN(off) : LONGALIGN(off);
else
- elog(ERROR, "fastgetiattr: attribute %d has len %d",
+ elog(ERROR, "nocache_index_getattr: attribute %d has len %d",
j, att[j]->attlen);
break;
off += att[j]->attlen;
}
- return (fetchatt(&(att[attnum]),
- tp + att[attnum]->attcacheoff));
+ return (Datum) fetchatt(&(att[attnum]),
+ tp + att[attnum]->attcacheoff);
}
else
{
DOUBLEALIGN(off) + att[i]->attlen :
LONGALIGN(off) + att[i]->attlen;
else
- elog(ERROR, "fastgetiattr2: attribute %d has len %d",
+ elog(ERROR, "nocache_index_getattr2: attribute %d has len %d",
i, att[i]->attlen);
break;
/*
* I don't know why this code was missed here! I've got it from
- * heaptuple.c:fastgetattr(). - vadim 06/12/97
+ * heaptuple.c:nocachegetattr(). - vadim 06/12/97
*/
switch (att[attnum]->attlen)
{
break;
default:
if (att[attnum]->attlen < sizeof(int32))
- elog(ERROR, "fastgetattr3: attribute %d has len %d",
+ elog(ERROR, "nocache_index_getattr: attribute %d has len %d",
attnum, att[attnum]->attlen);
if (att[attnum]->attalign == 'd')
off = DOUBLEALIGN(off);
break;
}
- return (fetchatt(&att[attnum], tp + off));
+ return (Datum) fetchatt(&att[attnum], tp + off);
}
}
-/* ----------------
- * index_getattr
- * ----------------
- */
-Datum
-index_getattr(IndexTuple tuple,
- AttrNumber attNum,
- TupleDesc tupDesc,
- bool *isNullOutP)
-{
- Assert(attNum > 0);
-
- return (Datum)
- fastgetiattr(tuple, attNum, tupDesc, isNullOutP);
-}
-
RetrieveIndexResult
FormRetrieveIndexResult(ItemPointer indexItemPointer,
ItemPointer heapItemPointer)
return (result);
}
-/*
- * Takes an infomask as argument (primarily because this needs to be usable
- * at index_formtuple time so enough space is allocated).
- *
- * Change me if adding an attribute to IndexTuples!!!!!!!!!!!
- */
-static Size
-IndexInfoFindDataOffset(unsigned short t_info)
-{
- if (!(t_info & INDEX_NULL_MASK))
- return ((Size) sizeof(IndexTupleData));
- else
- {
- Size size = sizeof(IndexTupleData);
-
- if (t_info & INDEX_NULL_MASK)
- {
- size += sizeof(IndexAttributeBitMapData);
- }
- return DOUBLEALIGN(size); /* be conservative */
- }
-}
-
/*
* Copies source into target. If *target == NULL, we palloc space; otherwise
* we assume we have space that is already palloc'ed.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.22 1998/01/07 21:00:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.23 1998/01/31 04:38:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
i++; /* heap_getattr is a macro, so no
* increment */
- attr = heap_getattr(tuple, InvalidBuffer, i, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i, typeinfo, &isnull);
if (!isnull)
j |= k;
k >>= 1;
*/
for (i = 0; i < tuple->t_natts; ++i)
{
- attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
if (!isnull && OidIsValid(typoutput))
for (i = 0; i < tuple->t_natts; ++i)
{
- attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
if (!isnull && OidIsValid(typoutput))
{
i++; /* heap_getattr is a macro, so no
* increment */
- attr = heap_getattr(tuple, InvalidBuffer, i, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i, typeinfo, &isnull);
if (!isnull)
j |= k;
k >>= 1;
{
int32 len = typeinfo->attrs[i]->attlen;
- attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
if (!isnull)
{
/* # of bytes, and opaque data */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.19 1998/01/07 21:01:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.20 1998/01/31 04:38:06 momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
for (i = 0; i < FIgetnArgs(fInfo); i++)
{
attData[i] = heap_getattr(tuple,
- buffer,
attrNums[i],
hTupDesc,
attNull);
}
else
{
- returnVal = heap_getattr(tuple, buffer, attrNums[attOff],
+ returnVal = heap_getattr(tuple, attrNums[attOff],
hTupDesc, attNull);
}
return returnVal;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.3 1998/01/15 19:42:26 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.4 1998/01/31 04:38:11 momjian Exp $
*
* NOTES
* See acl.h.
return;
}
if (!heap_attisnull(htp, Anum_pg_class_relacl))
- old_acl = (Acl *) heap_getattr(htp, buffer,
+ old_acl = (Acl *) heap_getattr(htp,
Anum_pg_class_relacl,
RelationGetTupleDescriptor(relation),
(bool *) NULL);
if (HeapTupleIsValid(htp) &&
!heap_attisnull(htp, Anum_pg_group_grolist))
{
- tmp = (IdList *) heap_getattr(htp, InvalidBuffer,
+ tmp = (IdList *) heap_getattr(htp,
Anum_pg_group_grolist,
RelationGetTupleDescriptor(relation),
(bool *) NULL);
if (!heap_attisnull(htp, Anum_pg_class_relacl))
{
relation = heap_openr(RelationRelationName);
- tmp = (Acl *) heap_getattr(htp, InvalidBuffer,
+ tmp = (Acl *) heap_getattr(htp,
Anum_pg_class_relacl,
RelationGetTupleDescriptor(relation),
(bool *) NULL);
Oid ownerId;
relation = heap_openr(RelationRelationName);
- ownerId = (Oid) heap_getattr(htp, InvalidBuffer,
+ ownerId = (Oid) heap_getattr(htp,
Anum_pg_class_relowner,
RelationGetTupleDescriptor(relation),
(bool *) NULL);
if (HeapTupleIsValid(htp) &&
!heap_attisnull(htp, Anum_pg_class_relacl))
{
- tmp = (Acl *) heap_getattr(htp, InvalidBuffer,
+ tmp = (Acl *) heap_getattr(htp,
Anum_pg_class_relacl,
RelationGetTupleDescriptor(relation),
(bool *) NULL);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.27 1998/01/25 05:12:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.28 1998/01/31 04:38:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{
- d = heap_getattr(lTuple, b, Anum_pg_listener_notify,
+ d = heap_getattr(lTuple, Anum_pg_listener_notify,
tdesc, &isnull);
if (!DatumGetInt32(d))
{
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{
- d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
+ d = heap_getattr(lTuple, Anum_pg_listener_relname,
tdesc, &isnull);
if (AsyncExistsPendingNotify((char *) DatumGetPointer(d)))
{
- d = heap_getattr(lTuple, b, Anum_pg_listener_pid,
+ d = heap_getattr(lTuple, Anum_pg_listener_pid,
tdesc, &isnull);
if (MyProcPid == DatumGetInt32(d))
s = heap_beginscan(lDesc, 0, false, 0, (ScanKey) NULL);
while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b)))
{
- d = heap_getattr(htup, b, Anum_pg_listener_relname, tdesc,
+ d = heap_getattr(htup, Anum_pg_listener_relname, tdesc,
&isnull);
relnamei = DatumGetPointer(d);
if (!strncmp(relnamei, relname, NAMEDATALEN))
{
- d = heap_getattr(htup, b, Anum_pg_listener_pid, tdesc, &isnull);
+ d = heap_getattr(htup, Anum_pg_listener_pid, tdesc, &isnull);
pid = DatumGetInt32(d);
if (pid == MyProcPid)
{
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{
- d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
+ d = heap_getattr(lTuple, Anum_pg_listener_relname,
tdesc, &isnull);
rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl);
heap_replace(lRel, &lTuple->t_ctid, rTuple);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.39 1998/01/16 23:19:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.40 1998/01/31 04:38:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
for (i = 0; i < attr_count; i++)
{
- value = heap_getattr(tuple, InvalidBuffer, i + 1, tupDesc, &isnull);
+ value = heap_getattr(tuple, i + 1, tupDesc, &isnull);
if (!binary)
{
if (!isnull)
{
index_relation_oid =
- (Oid) DatumGetInt32(heap_getattr(tuple, InvalidBuffer, 2,
+ (Oid) DatumGetInt32(heap_getattr(tuple, 2,
tupDesc, &isnull));
if (index_relation_oid == main_relation_oid)
{
scan->index_rel_oid =
- (Oid) DatumGetInt32(heap_getattr(tuple, InvalidBuffer,
+ (Oid) DatumGetInt32(heap_getattr(tuple,
Anum_pg_index_indexrelid,
tupDesc, &isnull));
(*n_indices)++;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.5 1998/01/05 16:38:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.6 1998/01/31 04:38:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (dbfound)
{
- dbowner = (Oid) heap_getattr(dbtup, InvalidBuffer,
+ dbowner = (Oid) heap_getattr(dbtup,
Anum_pg_database_datdba,
RelationGetTupleDescriptor(dbrel),
(char *) NULL);
*dbIdP = dbtup->t_oid;
- dbtext = (text *) heap_getattr(dbtup, InvalidBuffer,
+ dbtext = (text *) heap_getattr(dbtup,
Anum_pg_database_datpath,
RelationGetTupleDescriptor(dbrel),
(char *) NULL);
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
- datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_user_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_user_usename, pg_user_dsc, &n);
if (!exists && !strncmp((char*)datum, stmt->user, strlen(stmt->user)))
exists = true;
- datum = heap_getattr(tuple, buffer, Anum_pg_user_usesysid, pg_user_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_user_usesysid, pg_user_dsc, &n);
if ((int)datum > max_id)
max_id = (int)datum;
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
- datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_user_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_user_usename, pg_user_dsc, &n);
if (!strncmp((char*)datum, stmt->user, strlen(stmt->user))) {
exists = true;
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
- datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_user_usename, pg_dsc, &n);
if (!strncmp((char*)datum, user, strlen(user))) {
- usesysid = (int)heap_getattr(tuple, buffer, Anum_pg_user_usesysid, pg_dsc, &n);
+ usesysid = (int)heap_getattr(tuple, Anum_pg_user_usesysid, pg_dsc, &n);
ReleaseBuffer(buffer);
break;
}
scan = heap_beginscan(pg_rel, false, false, 0, NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
- datum = heap_getattr(tuple, buffer, Anum_pg_database_datdba, pg_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_database_datdba, pg_dsc, &n);
if ((int)datum == usesysid) {
- datum = heap_getattr(tuple, buffer, Anum_pg_database_datname, pg_dsc, &n);
+ datum = heap_getattr(tuple, Anum_pg_database_datname, pg_dsc, &n);
if (memcmp((void*)datum, "template1", 9)) {
dbase = (char**)realloc((void*)dbase, sizeof(char*) * (ndbase + 1));
dbase[ndbase] = (char*)malloc(NAMEDATALEN + 1);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.58 1998/01/15 19:42:40 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.59 1998/01/31 04:38:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
found = true;
- d = heap_getattr(pgctup, buf, Anum_pg_class_relname, pgcdesc, &n);
+ d = heap_getattr(pgctup, Anum_pg_class_relname, pgcdesc, &n);
rname = (char *) d;
/*
continue;
}
- d = heap_getattr(pgctup, buf, Anum_pg_class_relkind, pgcdesc, &n);
+ d = heap_getattr(pgctup, Anum_pg_class_relkind, pgcdesc, &n);
rkind = DatumGetChar(d);
VacAttrStats *stats = &vacattrstats[i];
bool value_hit = true;
- value = heap_getattr(htup, InvalidBuffer,
+ value = heap_getattr(htup,
stats->attr->attnum, tupDesc, &isnull);
if (!VacAttrStatsEqValid(stats))
while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL)))
{
- d = heap_getattr(pgitup, InvalidBuffer, Anum_pg_index_indexrelid,
+ d = heap_getattr(pgitup, Anum_pg_index_indexrelid,
pgidesc, &n);
i++;
if (i % 10 == 0)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.9 1997/09/12 04:07:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.10 1998/01/31 04:38:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
tuple = slot->val;
tupType = (TupleDesc) junkfilter->jf_tupType;
- *value = heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
+ *value = heap_getattr(tuple, resno, tupType, isNull);
return true;
}
for (i = 0; i < cleanLength; i++)
{
values[i] =
- heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
+ heap_getattr(tuple, cleanMap[i], tupType, &isNull);
if (isNull)
nulls[i] = 'n';
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.23 1998/01/15 19:44:24 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.24 1998/01/31 04:38:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
result = heap_getattr(heapTuple, /* tuple containing attribute */
- buffer, /* buffer associated with tuple */
attnum, /* attribute number of desired attribute */
tuple_type,/* tuple descriptor of tuple */
isNull); /* return: is attribute null? */
}
retval = heap_getattr(slot->val,
- slot->ttc_buffer,
attrno,
slot->ttc_tupleDescriptor,
isNull);
elog(ERROR, "GetAttributeByName: attribute %s not found", attname);
retval = heap_getattr(slot->val,
- slot->ttc_buffer,
attrno,
tupdesc,
isNull);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.14 1997/12/11 17:36:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.15 1998/01/31 04:38:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
AttrNumber attrno = attrVar->varattno;
- val = heap_getattr(tup, InvalidBuffer, attrno, TD, isnullP);
+ val = heap_getattr(tup, attrno, TD, isnullP);
if (*isnullP)
return (Datum) NULL;
result =
heap_getattr(heapTuple, /* tuple containing attribute */
- buffer, /* buffer associated with tuple */
attnum, /* attribute number of desired attribute */
tuple_type,/* tuple descriptor of tuple */
isNull); /* return: is attribute null? */
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.13 1998/01/27 15:41:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.14 1998/01/31 04:38:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid);
attr1 = heap_getattr(oldslot->val,
- InvalidBuffer,
att,
tupdesc,
&isNull1);
attr2 = heap_getattr(newslot->val,
- InvalidBuffer,
att,
tupdesc,
&isNull2);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.11 1997/09/12 04:07:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.12 1998/01/31 04:38:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *val1,
*val2;
- attr1 = heap_getattr(slot->val, InvalidBuffer,
+ attr1 = heap_getattr(slot->val,
uniqueAttrNum, tupDesc, &isNull1);
- attr2 = heap_getattr(resultTupleSlot->val, InvalidBuffer,
+ attr2 = heap_getattr(resultTupleSlot->val,
uniqueAttrNum, tupDesc, &isNull2);
if (isNull1 == isNull2)
/* fetch old values and nulls */
for (i = 0; i < numberOfAttributes; i++)
{
- v[i] = heap_getattr(tuple, InvalidBuffer, i + 1, rel->rd_att, &isnull);
+ v[i] = heap_getattr(tuple, i + 1, rel->rd_att, &isnull);
n[i] = (isnull) ? 'n' : ' ';
}
return (NULL);
}
- val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, &isnull);
+ val = heap_getattr(tuple, fnumber, tupdesc, &isnull);
if (isnull)
return (NULL);
foutoid = typtoout((Oid) tupdesc->attrs[fnumber - 1]->atttypid);
return ((Datum) NULL);
}
- val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, isnull);
+ val = heap_getattr(tuple, fnumber, tupdesc, isnull);
return (val);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.10 1998/01/26 01:41:05 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.11 1998/01/31 04:38:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
for (i = 0; i < tuple->t_natts; i++)
{
- attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
+ attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
lengths[i] = typeinfo->attrs[i]->attlen;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.9 1998/01/07 21:04:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.10 1998/01/31 04:38:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Oid ruleId = (Oid) 0;
Oid eventRelationOid = (Oid) NULL;
Datum eventRelationOidDatum = (Datum) NULL;
- Buffer buffer = (Buffer) NULL;
bool isNull = false;
/*
ruleId = tuple->t_oid;
eventRelationOidDatum =
heap_getattr(tuple,
- buffer,
Anum_pg_rewrite_ev_class,
RelationGetTupleDescriptor(RewriteRelation),
&isNull);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.14 1998/01/07 21:04:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.15 1998/01/31 04:38:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "rule %u isn't in rewrite system relation", ruleoid);
ruleaction = (char *)heap_getattr(ruletuple,
- InvalidBuffer,
Anum_pg_rewrite_ev_action,
ruleTupdesc,
&action_is_null);
- rule_evqual_string = (char *)heap_getattr(ruletuple, InvalidBuffer,
+ rule_evqual_string = (char *)heap_getattr(ruletuple,
Anum_pg_rewrite_ev_qual,
ruleTupdesc, &action_is_null);
- *instead_flag = !!heap_getattr(ruletuple, InvalidBuffer,
+ *instead_flag = !!heap_getattr(ruletuple,
Anum_pg_rewrite_is_instead,
ruleTupdesc, &instead_is_null);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.26 1998/01/07 21:05:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.27 1998/01/31 04:38:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
/* copy the data from this block into the buffer */
- d = heap_getattr(htup, b, 2, obj_desc->hdesc, &isNull);
+ d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d);
off = obj_desc->offset - obj_desc->lowbyte;
* return the tuple.
*/
- d = heap_getattr(htup, *bufP, 1, obj_desc->hdesc, &isNull);
+ d = heap_getattr(htup, 1, obj_desc->hdesc, &isNull);
lastbyte = (int32) DatumGetInt32(d);
- d = heap_getattr(htup, *bufP, 2, obj_desc->hdesc, &isNull);
+ d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d);
/*
newpage = BufferGetPage(newbuf);
hr = obj_desc->heap_r;
freespc = IFREESPC(page);
- d = heap_getattr(htup, buffer, 2, obj_desc->hdesc, &isNull);
+ d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d);
tupbytes = fsblock->vl_len - sizeof(fsblock->vl_len);
index_endscan(iscan);
/* get olastbyte attribute */
- d = heap_getattr(htup, buf, 1, hdesc, &isNull);
+ d = heap_getattr(htup, 1, hdesc, &isNull);
size = DatumGetInt32(d) + 1;
/* wei hates it if you forget to do this */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.7 1997/11/20 23:22:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.8 1998/01/31 04:38:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
current_tuple = heap_getnext(scan_descriptor, 0, NULL))
{
value = heap_getattr(current_tuple,
- InvalidBuffer,
(AttrNumber) attrid,
RelationGetTupleDescriptor(relation_to_scan),
&dummy);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.12 1998/01/05 16:40:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.13 1998/01/31 04:38:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
case 1:
result = (RegProcedure) heap_getattr(proctup,
- InvalidBuffer,
ObjectIdAttributeNumber,
RelationGetTupleDescriptor(proc),
&isnull);
bool isnull;
case 1:
- s = (char *) heap_getattr(proctup, InvalidBuffer, 1,
+ s = (char *) heap_getattr(proctup, 1,
RelationGetTupleDescriptor(proc), &isnull);
if (!isnull)
{
char *s;
bool isnull;
- s = (char *) heap_getattr(typetup, InvalidBuffer, 1,
+ s = (char *) heap_getattr(typetup, 1,
RelationGetTupleDescriptor(type), &isnull);
if (!isnull)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.14 1998/01/05 16:40:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.15 1998/01/31 04:38:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
*high = textout((struct varlena *)
heap_getattr(tuple,
- InvalidBuffer,
Anum_pg_statistic_stahikey,
RelationGetTupleDescriptor(rdesc),
&isnull));
elog(DEBUG, "gethilokey: high key is null");
*low = textout((struct varlena *)
heap_getattr(tuple,
- InvalidBuffer,
Anum_pg_statistic_stalokey,
RelationGetTupleDescriptor(rdesc),
&isnull));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.34 1998/01/15 19:45:31 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.35 1998/01/31 04:38:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
rule->ruleId = pg_rewrite_tuple->t_oid;
rule->event =
- (int) heap_getattr(pg_rewrite_tuple, InvalidBuffer,
+ (int) heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc,
&isnull) - 48;
rule->attrno =
- (int) heap_getattr(pg_rewrite_tuple, InvalidBuffer,
+ (int) heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc,
&isnull);
rule->isInstead =
- !!heap_getattr(pg_rewrite_tuple, InvalidBuffer,
+ !!heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
&isnull);
ruleaction =
- heap_getattr(pg_rewrite_tuple, InvalidBuffer,
+ heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
&isnull);
rule_evqual_string =
- heap_getattr(pg_rewrite_tuple, InvalidBuffer,
+ heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
&isnull);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.12 1998/01/07 21:06:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.13 1998/01/31 04:38:54 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
}
attributeValue = heap_getattr(tp,
- (Buffer) 0,
attributeNumber,
RelationGetTupleDescriptor(relation),
&isNull);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.16 1998/01/07 21:06:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.17 1998/01/31 04:38:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ProcedureRelationName);
return ((func_ptr) NULL);
}
- probinattr = heap_getattr(procedureTuple, (Buffer) 0,
+ probinattr = heap_getattr(procedureTuple,
Anum_pg_proc_probin,
RelationGetTupleDescriptor(rdesc), &isnull);
if (!PointerIsValid(probinattr) /* || isnull */ )
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.5 1998/01/07 21:06:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.6 1998/01/31 04:39:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return TRUE;
}
- dbowner = (Oid) heap_getattr(dbtup, InvalidBuffer,
+ dbowner = (Oid) heap_getattr(dbtup,
Anum_pg_database_datdba,
RelationGetTupleDescriptor(dbrel),
(char *) NULL);
dbid = dbtup->t_oid;
- dbtext = (text *) heap_getattr(dbtup, InvalidBuffer,
+ dbtext = (text *) heap_getattr(dbtup,
Anum_pg_database_datpath,
RelationGetTupleDescriptor(dbrel),
(char *) NULL);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.10 1998/01/15 19:46:08 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.11 1998/01/31 04:39:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return (1);
while (nkey < context->nKeys && !result)
{
- lattr = heap_getattr(ltup, InvalidBuffer,
+ lattr = heap_getattr(ltup,
context->scanKeys[nkey].sk_attno,
context->tupDesc, &isnull);
if (isnull)
return (0);
- rattr = heap_getattr(rtup, InvalidBuffer,
+ rattr = heap_getattr(rtup,
context->scanKeys[nkey].sk_attno,
context->tupDesc,
&isnull);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.34 1998/01/25 05:18:34 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.35 1998/01/31 04:39:13 momjian Exp $
*
* NOTES
* Sorts the first relation into the second relation.
for (nkey = 0; nkey < PsortNkeys && !result; nkey++ )
{
- lattr = heap_getattr(*ltup, InvalidBuffer,
+ lattr = heap_getattr(*ltup,
PsortKeys[nkey].sk_attno,
PsortTupDesc,
&isnull1);
- rattr = heap_getattr(*rtup, InvalidBuffer,
+ rattr = heap_getattr(*rtup,
PsortKeys[nkey].sk_attno,
PsortTupDesc,
&isnull2);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: heapam.h,v 1.26 1998/01/27 15:57:41 momjian Exp $
+ * $Id: heapam.h,v 1.27 1998/01/31 04:39:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef HEAPAM_H
#define HEAPAM_H
#include
#define IncrHeapAccessStat(x) \
(heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
+/* ----------------
+ * fastgetattr
+ *
+ * This gets called many times, so we macro the cacheable and NULL
+ * lookups, and call noncachegetattr() for the rest.
+ *
+ * ----------------
+ */
+#define fastgetattr(tup, attnum, tupleDesc, isnull) \
+( \
+ AssertMacro((attnum) > 0) ? \
+ ( \
+ ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
+ HeapTupleNoNulls(tup) ? \
+ ( \
+ ((tupleDesc)->attrs[(attnum)-1]->attcacheoff > 0) ? \
+ ( \
+ (Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
+ (char *) (tup) + (tup)->t_hoff + (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \
+ ) \
+ : \
+ ( \
+ ((attnum)-1 == 0) ? \
+ ( \
+ (Datum)fetchatt(&((tupleDesc)->attrs[0]), (char *) (tup) + (tup)->t_hoff) \
+ ) \
+ : \
+ ( \
+ nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
+ ) \
+ ) \
+ ) \
+ : \
+ ( \
+ att_isnull((attnum)-1, (tup)->t_bits) ? \
+ ( \
+ ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
+ (Datum)NULL \
+ ) \
+ : \
+ ( \
+ nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
+ ) \
+ ) \
+ ) \
+ : \
+ ( \
+ (Datum)NULL \
+ ) \
+)
+
+
+
/* ----------------
* heap_getattr
*
* Because this macro is often called with constants, it generates
* compiler warnings about 'left-hand comma expression has no effect.
*
- * ---------------- */
-#define heap_getattr(tup, b, attnum, tupleDesc, isnull) \
- (AssertMacro((tup) != NULL) ? \
+ * ----------------
+ */
+#define heap_getattr(tup, attnum, tupleDesc, isnull) \
+( \
+ AssertMacro((tup) != NULL && \
+ (attnum) > FirstLowInvalidHeapAttributeNumber && \
+ (attnum) != 0) ? \
+ ( \
((attnum) > (int) (tup)->t_natts) ? \
- (((isnull) ? (*(isnull) = true) : (dummyret)NULL), (Datum)NULL) : \
- ((attnum) > 0) ? \
- fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
- (((isnull) ? (*(isnull) = false) : (dummyret)NULL), heap_getsysattr((tup), (b), (attnum))) : \
- (Datum)NULL)
+ ( \
+ ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
+ (Datum)NULL \
+ ) \
+ : \
+ ( \
+ ((attnum) > 0) ? \
+ ( \
+ fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
+ ) \
+ : \
+ ( \
+ ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
+ ((attnum) == SelfItemPointerAttributeNumber) ? \
+ ( \
+ (Datum)((char *)(tup) + \
+ heap_sysoffset[-SelfItemPointerAttributeNumber-1]) \
+ ) \
+ : \
+ ( \
+ (Datum)*(unsigned int *) \
+ ((char *)(tup) + heap_sysoffset[-(attnum)-1]) \
+ ) \
+ ) \
+ ) \
+ ) \
+ : \
+ ( \
+ (Datum)NULL \
+ ) \
+)
extern HeapAccessStatistics heap_access_stats; /* in stats.c */
extern int heap_sysattrlen(AttrNumber attno);
extern bool heap_sysattrbyval(AttrNumber attno);
extern Datum heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
-extern Datum fastgetattr(HeapTuple tup, int attnum,
+extern Datum nocachegetattr(HeapTuple tup, int attnum,
TupleDesc att, bool *isnull);
extern HeapTuple heap_copytuple(HeapTuple tuple);
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: htup.h,v 1.7 1997/11/02 15:26:42 vadim Exp $
+ * $Id: htup.h,v 1.8 1998/01/31 04:39:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define MaxCommandIdAttributeNumber (-6)
#define FirstLowInvalidHeapAttributeNumber (-7)
+/* If you make any changes above, the order off offsets in this must change */
+extern long heap_sysoffset[];
/* ----------------
* support macros
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: itup.h,v 1.9 1998/01/24 22:48:06 momjian Exp $
+ * $Id: itup.h,v 1.10 1998/01/31 04:39:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef ITUP_H
#define ITUP_H
#include
+#include
#define MaxIndexAttributeNumber 7
#define IndexTupleHasMinHeader(itup) (IndexTupleNoNulls(itup))
+/*
+ * Takes an infomask as argument (primarily because this needs to be usable
+ * at index_formtuple time so enough space is allocated).
+ *
+ * Change me if adding an attribute to IndexTuples!!!!!!!!!!!
+ */
+#define IndexInfoFindDataOffset(t_info) \
+( \
+ (!((unsigned short)(t_info) & INDEX_NULL_MASK)) ? \
+ ( \
+ (Size)sizeof(IndexTupleData) \
+ ) \
+ : \
+ ( \
+ (Size)DOUBLEALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
+ ) \
+)
+/* ----------------
+ * index_getattr
+ *
+ * This gets called many times, so we macro the cacheable and NULL
+ * lookups, and call noncachegetattr() for the rest.
+ *
+ * ----------------
+ */
+#define index_getattr(tup, attnum, tupleDesc, isnull) \
+( \
+ AssertMacro(PointerIsValid(isnull) && (attnum) > 0) ? \
+ ( \
+ *(isnull) = false, \
+ IndexTupleNoNulls(tup) ? \
+ ( \
+ ((tupleDesc)->attrs[(attnum)-1]->attcacheoff > 0) ? \
+ ( \
+ (Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
+ (char *) (tup) + \
+ (IndexTupleHasMinHeader(tup) ? sizeof (*(tup)) : \
+ IndexInfoFindDataOffset((tup)->t_info)) + \
+ (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \
+ ) \
+ : \
+ ( \
+ ((attnum)-1 == 0) ? \
+ ( \
+ (Datum)fetchatt(&((tupleDesc)->attrs[0]), \
+ (char *) (tup) + \
+ (IndexTupleHasMinHeader(tup) ? sizeof (*(tup)) : \
+ IndexInfoFindDataOffset((tup)->t_info))) \
+ ) \
+ : \
+ ( \
+ nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
+ ) \
+ ) \
+ ) \
+ : \
+ ( \
+ (att_isnull((attnum)-1, (char *)(tup) + sizeof(*(tup)))) ? \
+ ( \
+ *(isnull) = true, \
+ (Datum)NULL \
+ ) \
+ : \
+ ( \
+ nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
+ ) \
+ ) \
+ ) \
+ : \
+ ( \
+ (Datum)NULL \
+ ) \
+)
+
+
/* indextuple.h */
extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
Datum value[], char null[]);
-extern Datum index_getattr(IndexTuple tuple, AttrNumber attNum,
- TupleDesc tupDesc, bool *isNullOutP);
+extern Datum nocache_index_getattr(IndexTuple tup, int attnum,
+ TupleDesc tupleDesc, bool *isnull);
extern RetrieveIndexResult FormRetrieveIndexResult(ItemPointer indexItemPointer,
ItemPointer heapItemPointer);
extern void CopyIndexTuple(IndexTuple source, IndexTuple *target);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: valid.h,v 1.12 1998/01/15 19:46:18 pgsql Exp $
+ * $Id: valid.h,v 1.13 1998/01/31 04:39:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
(result) = true; /* may change */ \
for (; __cur_nkeys--; __cur_keys++) \
{ \
- __atp = heap_getattr((tuple), InvalidBuffer, \
+ __atp = heap_getattr((tuple), \
__cur_keys->sk_attno, \
(tupdesc), \
&__isnull); \
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_node.h,v 1.7 1998/01/20 22:12:16 momjian Exp $
+ * $Id: parse_node.h,v 1.8 1998/01/31 04:39:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* state information used during parse analysis */
typedef struct ParseState
{
- struct ParseState;
int p_last_resno;
List *p_rtable;
List *p_insert_columns;