heapattr functions now return a Datum, not char *.

This commit is contained in:
Bruce Momjian 1997-09-12 04:09:08 +00:00
parent 6e04b4b20f
commit 1ea01720d5
28 changed files with 177 additions and 188 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.24 1997/09/08 21:40:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.25 1997/09/12 04:07:06 momjian Exp $
* *
* NOTES * NOTES
* The old interface functions have been converted to macros * The old interface functions have been converted to macros
@ -372,25 +372,25 @@ heap_sysattrbyval(AttrNumber attno)
* heap_getsysattr * heap_getsysattr
* ---------------- * ----------------
*/ */
char * Datum
heap_getsysattr(HeapTuple tup, Buffer b, int attnum) heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
{ {
switch (attnum) switch (attnum)
{ {
case SelfItemPointerAttributeNumber: case SelfItemPointerAttributeNumber:
return ((char *) &tup->t_ctid); return ((Datum) &tup->t_ctid);
case ObjectIdAttributeNumber: case ObjectIdAttributeNumber:
return ((char *) (long) tup->t_oid); return ((Datum) (long) tup->t_oid);
case MinTransactionIdAttributeNumber: case MinTransactionIdAttributeNumber:
return ((char *) (long) tup->t_xmin); return ((Datum) (long) tup->t_xmin);
case MinCommandIdAttributeNumber: case MinCommandIdAttributeNumber:
return ((char *) (long) tup->t_cmin); return ((Datum) (long) tup->t_cmin);
case MaxTransactionIdAttributeNumber: case MaxTransactionIdAttributeNumber:
return ((char *) (long) tup->t_xmax); return ((Datum) (long) tup->t_xmax);
case MaxCommandIdAttributeNumber: case MaxCommandIdAttributeNumber:
return ((char *) (long) tup->t_cmax); return ((Datum) (long) tup->t_cmax);
case ChainItemPointerAttributeNumber: case ChainItemPointerAttributeNumber:
return ((char *) &tup->t_chain); return ((Datum) &tup->t_chain);
case AnchorItemPointerAttributeNumber: case AnchorItemPointerAttributeNumber:
elog(WARN, "heap_getsysattr: t_anchor does not exist!"); elog(WARN, "heap_getsysattr: t_anchor does not exist!");
break; break;
@ -409,7 +409,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
if (!AbsoluteTimeIsBackwardCompatiblyValid(tup->t_tmin) && if (!AbsoluteTimeIsBackwardCompatiblyValid(tup->t_tmin) &&
TransactionIdDidCommit(tup->t_xmin)) TransactionIdDidCommit(tup->t_xmin))
tup->t_tmin = TransactionIdGetCommitTime(tup->t_xmin); tup->t_tmin = TransactionIdGetCommitTime(tup->t_xmin);
return ((char *) (long) tup->t_tmin); return ((Datum) (long) tup->t_tmin);
case MaxAbsoluteTimeAttributeNumber: case MaxAbsoluteTimeAttributeNumber:
if (!AbsoluteTimeIsBackwardCompatiblyReal(tup->t_tmax)) if (!AbsoluteTimeIsBackwardCompatiblyReal(tup->t_tmax))
{ {
@ -418,9 +418,9 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
else else
tup->t_tmax = CURRENT_ABSTIME; tup->t_tmax = CURRENT_ABSTIME;
} }
return ((char *) (long) tup->t_tmax); return ((Datum) (long) tup->t_tmax);
case VersionTypeAttributeNumber: case VersionTypeAttributeNumber:
return ((char *) (long) tup->t_vtype); return ((Datum) (long) tup->t_vtype);
default: default:
elog(WARN, "heap_getsysattr: undefined attnum %d", attnum); elog(WARN, "heap_getsysattr: undefined attnum %d", attnum);
} }
@ -444,7 +444,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
* the same attribute descriptor will go much quicker. -cim 5/4/91 * the same attribute descriptor will go much quicker. -cim 5/4/91
* ---------------- * ----------------
*/ */
char * Datum
fastgetattr(HeapTuple tup, fastgetattr(HeapTuple tup,
int attnum, int attnum,
TupleDesc tupleDesc, TupleDesc tupleDesc,
@ -479,7 +479,7 @@ fastgetattr(HeapTuple tup,
attnum--; attnum--;
if (att[attnum]->attcacheoff > 0) if (att[attnum]->attcacheoff > 0)
{ {
return (char *) return (Datum)
fetchatt(&(att[attnum]), fetchatt(&(att[attnum]),
(char *) tup + tup->t_hoff + att[attnum]->attcacheoff); (char *) tup + tup->t_hoff + att[attnum]->attcacheoff);
} }
@ -489,7 +489,7 @@ fastgetattr(HeapTuple tup,
/* /*
* first attribute is always at position zero * first attribute is always at position zero
*/ */
return ((char *) fetchatt(&(att[0]), (char *) tup + tup->t_hoff)); return ((Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
} }
tp = (char *) tup + tup->t_hoff; tp = (char *) tup + tup->t_hoff;
@ -543,13 +543,13 @@ fastgetattr(HeapTuple tup,
{ {
if (att[attnum]->attcacheoff > 0) if (att[attnum]->attcacheoff > 0)
{ {
return (char *) return (Datum)
fetchatt(&(att[attnum]), fetchatt(&(att[attnum]),
tp + att[attnum]->attcacheoff); tp + att[attnum]->attcacheoff);
} }
else if (attnum == 0) else if (attnum == 0)
{ {
return (char *) return (Datum)
fetchatt(&(att[0]), (char *) tup + tup->t_hoff); fetchatt(&(att[0]), (char *) tup + tup->t_hoff);
} }
else if (!HeapTupleAllFixed(tup)) else if (!HeapTupleAllFixed(tup))
@ -618,7 +618,7 @@ fastgetattr(HeapTuple tup,
} }
return return
(char *) fetchatt(&(att[attnum]), tp + att[attnum]->attcacheoff); (Datum) fetchatt(&(att[attnum]), tp + att[attnum]->attcacheoff);
} }
else else
{ {
@ -729,7 +729,7 @@ fastgetattr(HeapTuple tup,
off = LONGALIGN(off); off = LONGALIGN(off);
break; break;
} }
return ((char *) fetchatt(&(att[attnum]), tp + off)); return ((Datum) fetchatt(&(att[attnum]), tp + off));
} }
} }
@ -782,11 +782,11 @@ heap_deformtuple(HeapTuple tuple,
{ {
bool isnull; bool isnull;
values[i] = (Datum) heap_getattr(tuple, values[i] = heap_getattr(tuple,
InvalidBuffer, InvalidBuffer,
i + 1, i + 1,
tdesc, tdesc,
&isnull); &isnull);
if (isnull) if (isnull)
nulls[i] = 'n'; nulls[i] = 'n';
else else
@ -936,15 +936,12 @@ heap_modifytuple(HeapTuple tuple,
if (repl[attoff] == ' ') if (repl[attoff] == ' ')
{ {
char *attr; value[attoff] =
attr =
heap_getattr(tuple, heap_getattr(tuple,
InvalidBuffer, InvalidBuffer,
AttrOffsetGetAttrNumber(attoff), AttrOffsetGetAttrNumber(attoff),
RelationGetTupleDescriptor(relation), RelationGetTupleDescriptor(relation),
&isNull); &isNull);
value[attoff] = PointerGetDatum(attr);
nulls[attoff] = (isNull) ? 'n' : ' '; nulls[attoff] = (isNull) ? 'n' : ' ';
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.18 1997/09/08 02:19:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.19 1997/09/12 04:07:09 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -42,10 +42,10 @@ heap_keytest(HeapTuple t,
for (; nkeys--; keys++) for (; nkeys--; keys++)
{ {
atp = (Datum) heap_getattr(t, InvalidBuffer, atp = heap_getattr(t, InvalidBuffer,
keys->sk_attno, keys->sk_attno,
tupdesc, tupdesc,
&isnull); &isnull);
if (isnull) if (isnull)
/* XXX eventually should check if SK_ISNULL */ /* XXX eventually should check if SK_ISNULL */

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.17 1997/09/08 02:19:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.18 1997/09/12 04:07:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -76,8 +76,8 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
int i, int i,
j, j,
k; k;
char *outputstr, char *outputstr;
*attr; Datum attr;
bool isnull; bool isnull;
Oid typoutput; Oid typoutput;
@ -176,8 +176,8 @@ void
debugtup(HeapTuple tuple, TupleDesc typeinfo) debugtup(HeapTuple tuple, TupleDesc typeinfo)
{ {
register int i; register int i;
char *attr, Datum attr;
*value; char *value;
bool isnull; bool isnull;
Oid typoutput; Oid typoutput;
@ -212,7 +212,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
int i, int i,
j, j,
k; k;
char *attr; Datum attr;
bool isnull; bool isnull;
/* ---------------- /* ----------------
@ -308,9 +308,10 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
else else
{ {
pq_putint(len, sizeof(int32)); pq_putint(len, sizeof(int32));
pq_putnchar(attr, len); pq_putnchar(DatumGetPointer(attr), len);
#ifdef IPORTAL_DEBUG #ifdef IPORTAL_DEBUG
fprintf(stderr, "byref length %d data %x\n", len, attr); fprintf(stderr, "byref length %d data %x\n", len,
DatumGetPointer(attr));
#endif #endif
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.16 1997/09/08 21:41:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.17 1997/09/12 04:07:15 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* index_open - open an index relation by relationId * index_open - open an index relation by relationId
@ -385,11 +385,11 @@ GetIndexValue(HeapTuple tuple,
for (i = 0; i < FIgetnArgs(fInfo); i++) for (i = 0; i < FIgetnArgs(fInfo); i++)
{ {
attData[i] = (Datum) heap_getattr(tuple, attData[i] = heap_getattr(tuple,
buffer, buffer,
attrNums[i], attrNums[i],
hTupDesc, hTupDesc,
attNull); attNull);
} }
returnVal = (Datum) fmgr_array_args(FIgetProcOid(fInfo), returnVal = (Datum) fmgr_array_args(FIgetProcOid(fInfo),
FIgetnArgs(fInfo), FIgetnArgs(fInfo),
@ -400,8 +400,8 @@ GetIndexValue(HeapTuple tuple,
} }
else else
{ {
returnVal = (Datum) heap_getattr(tuple, buffer, attrNums[attOff], returnVal = heap_getattr(tuple, buffer, attrNums[attOff],
hTupDesc, attNull); hTupDesc, attNull);
} }
return returnVal; return returnVal;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.19 1997/09/08 02:21:54 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.20 1997/09/12 04:07:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -216,8 +216,8 @@ Async_Notify(char *relname)
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b))) while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{ {
d = (Datum) heap_getattr(lTuple, b, Anum_pg_listener_notify, d = heap_getattr(lTuple, b, Anum_pg_listener_notify,
tdesc, &isnull); tdesc, &isnull);
if (!DatumGetInt32(d)) if (!DatumGetInt32(d))
{ {
rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl); rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl);
@ -293,13 +293,13 @@ Async_NotifyAtCommit()
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b))) while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{ {
d = (Datum) heap_getattr(lTuple, b, Anum_pg_listener_relname, d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
tdesc, &isnull); tdesc, &isnull);
if (AsyncExistsPendingNotify((char *) DatumGetPointer(d))) if (AsyncExistsPendingNotify((char *) DatumGetPointer(d)))
{ {
d = (Datum) heap_getattr(lTuple, b, Anum_pg_listener_pid, d = heap_getattr(lTuple, b, Anum_pg_listener_pid,
tdesc, &isnull); tdesc, &isnull);
if (ourpid == DatumGetInt32(d)) if (ourpid == DatumGetInt32(d))
{ {
@ -444,12 +444,12 @@ Async_Listen(char *relname, int pid)
s = heap_beginscan(lDesc, 0, NowTimeQual, 0, (ScanKey) NULL); s = heap_beginscan(lDesc, 0, NowTimeQual, 0, (ScanKey) NULL);
while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b))) while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b)))
{ {
d = (Datum) heap_getattr(htup, b, Anum_pg_listener_relname, tdesc, d = heap_getattr(htup, b, Anum_pg_listener_relname, tdesc,
&isnull); &isnull);
relnamei = DatumGetPointer(d); relnamei = DatumGetPointer(d);
if (!strncmp(relnamei, relname, NAMEDATALEN)) if (!strncmp(relnamei, relname, NAMEDATALEN))
{ {
d = (Datum) heap_getattr(htup, b, Anum_pg_listener_pid, tdesc, &isnull); d = heap_getattr(htup, b, Anum_pg_listener_pid, tdesc, &isnull);
pid = DatumGetInt32(d); pid = DatumGetInt32(d);
if (pid == ourPid) if (pid == ourPid)
{ {
@ -609,8 +609,8 @@ Async_NotifyFrontEnd()
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b))) while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
{ {
d = (Datum) heap_getattr(lTuple, b, Anum_pg_listener_relname, d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
tdesc, &isnull); tdesc, &isnull);
rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl); rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl);
heap_replace(lRel, &lTuple->t_ctid, rTuple); heap_replace(lRel, &lTuple->t_ctid, rTuple);

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.33 1997/09/08 21:42:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.34 1997/09/12 04:07:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -270,8 +270,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
for (i = 0; i < attr_count; i++) for (i = 0; i < attr_count; i++)
{ {
value = (Datum) value = heap_getattr(tuple, InvalidBuffer, i + 1, tupDesc, &isnull);
heap_getattr(tuple, InvalidBuffer, i + 1, tupDesc, &isnull);
if (!binary) if (!binary)
{ {
if (!isnull) if (!isnull)

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.46 1997/09/08 21:42:48 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.47 1997/09/12 04:07:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -308,8 +308,7 @@ vc_getrels(NameData *VacRelP)
* Berkeley. * Berkeley.
*/ */
d = (Datum) heap_getattr(pgctup, buf, Anum_pg_class_relname, d = heap_getattr(pgctup, buf, Anum_pg_class_relname, pgcdesc, &n);
pgcdesc, &n);
rname = (char *) d; rname = (char *) d;
/* skip archive relations */ /* skip archive relations */
@ -334,8 +333,7 @@ vc_getrels(NameData *VacRelP)
continue; continue;
} }
d = (Datum) heap_getattr(pgctup, buf, Anum_pg_class_relsmgr, d = heap_getattr(pgctup, buf, Anum_pg_class_relsmgr, pgcdesc, &n);
pgcdesc, &n);
smgrno = DatumGetInt16(d); smgrno = DatumGetInt16(d);
/* skip write-once storage managers */ /* skip write-once storage managers */
@ -345,8 +343,7 @@ vc_getrels(NameData *VacRelP)
continue; continue;
} }
d = (Datum) heap_getattr(pgctup, buf, Anum_pg_class_relkind, d = heap_getattr(pgctup, buf, Anum_pg_class_relkind, pgcdesc, &n);
pgcdesc, &n);
rkind = DatumGetChar(d); rkind = DatumGetChar(d);
@ -1714,8 +1711,8 @@ vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup)
VacAttrStats *stats = &vacattrstats[i]; VacAttrStats *stats = &vacattrstats[i];
bool value_hit = true; bool value_hit = true;
value = (Datum) heap_getattr(htup, InvalidBuffer, value = heap_getattr(htup, InvalidBuffer,
stats->attr->attnum, tupDesc, &isnull); stats->attr->attnum, tupDesc, &isnull);
if (!VacAttrStatsEqValid(stats)) if (!VacAttrStatsEqValid(stats))
continue; continue;
@ -2289,8 +2286,8 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel)
while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL))) while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL)))
{ {
d = (Datum) heap_getattr(pgitup, InvalidBuffer, Anum_pg_index_indexrelid, d = heap_getattr(pgitup, InvalidBuffer, Anum_pg_index_indexrelid,
pgidesc, &n); pgidesc, &n);
i++; i++;
if (i % 10 == 0) if (i % 10 == 0)
ioid = (Oid *) repalloc(ioid, (i + 10) * sizeof(Oid)); ioid = (Oid *) repalloc(ioid, (i + 10) * sizeof(Oid));

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.8 1997/09/08 21:42:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.9 1997/09/12 04:07:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -315,8 +315,7 @@ ExecGetJunkAttribute(JunkFilter *junkfilter,
tuple = slot->val; tuple = slot->val;
tupType = (TupleDesc) junkfilter->jf_tupType; tupType = (TupleDesc) junkfilter->jf_tupType;
*value = (Datum) *value = heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
return true; return true;
} }
@ -391,10 +390,8 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
*/ */
for (i = 0; i < cleanLength; i++) for (i = 0; i < cleanLength; i++)
{ {
Datum d = (Datum) values[i] =
heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull); heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
values[i] = d;
if (isNull) if (isNull)
nulls[i] = 'n'; nulls[i] = 'n';

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.16 1997/09/08 21:43:00 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.17 1997/09/12 04:07:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -305,12 +305,11 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
return (Datum) tempSlot; return (Datum) tempSlot;
} }
result = (Datum) result = heap_getattr(heapTuple, /* tuple containing attribute */
heap_getattr(heapTuple, /* tuple containing attribute */ buffer, /* buffer associated with tuple */
buffer, /* buffer associated with tuple */ attnum, /* attribute number of desired attribute */
attnum, /* attribute number of desired attribute */ tuple_type,/* tuple descriptor of tuple */
tuple_type,/* tuple descriptor of tuple */ isNull); /* return: is attribute null? */
isNull); /* return: is attribute null? */
/* ---------------- /* ----------------
* return null if att is null * return null if att is null
@ -530,12 +529,11 @@ GetAttributeByNum(TupleTableSlot *slot,
return (char *) NULL; return (char *) NULL;
} }
retval = (Datum) retval = heap_getattr(slot->val,
heap_getattr(slot->val, slot->ttc_buffer,
slot->ttc_buffer, attrno,
attrno, slot->ttc_tupleDescriptor,
slot->ttc_tupleDescriptor, isNull);
isNull);
if (*isNull) if (*isNull)
return (char *) NULL; return (char *) NULL;
return (char *) retval; return (char *) retval;
@ -595,12 +593,11 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
if (attrno == InvalidAttrNumber) if (attrno == InvalidAttrNumber)
elog(WARN, "GetAttributeByName: attribute %s not found", attname); elog(WARN, "GetAttributeByName: attribute %s not found", attname);
retval = (Datum) retval = heap_getattr(slot->val,
heap_getattr(slot->val, slot->ttc_buffer,
slot->ttc_buffer, attrno,
attrno, tupdesc,
tupdesc, isNull);
isNull);
if (*isNull) if (*isNull)
return (char *) NULL; return (char *) NULL;
return (char *) retval; return (char *) retval;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.10 1997/09/08 21:43:08 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.11 1997/09/12 04:07:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -83,11 +83,7 @@ ProjectAttribute(TupleDesc TD,
AttrNumber attrno = attrVar->varattno; AttrNumber attrno = attrVar->varattno;
val = PointerGetDatum(heap_getattr(tup, val = heap_getattr(tup, InvalidBuffer, attrno, TD, isnullP);
InvalidBuffer,
attrno,
TD,
isnullP));
if (*isnullP) if (*isnullP)
return (Datum) NULL; return (Datum) NULL;

View File

@ -638,7 +638,7 @@ aggGetAttr(TupleTableSlot *slot,
return (Datum) tempSlot; return (Datum) tempSlot;
} }
result = (Datum) result =
heap_getattr(heapTuple, /* tuple containing attribute */ heap_getattr(heapTuple, /* tuple containing attribute */
buffer, /* buffer associated with tuple */ buffer, /* buffer associated with tuple */
attnum, /* attribute number of desired attribute */ attnum, /* attribute number of desired attribute */

View File

@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive) * columns. (ie. tuples from the same group are consecutive)
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.9 1997/09/08 21:43:10 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.10 1997/09/12 04:07:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -388,8 +388,8 @@ sameGroup(TupleTableSlot *oldslot,
{ {
bool isNull1, bool isNull1,
isNull2; isNull2;
char *attr1, Datum attr1,
*attr2; attr2;
char *val1, char *val1,
*val2; *val2;
int i; int i;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.10 1997/09/08 21:43:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.11 1997/09/12 04:07:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -182,8 +182,8 @@ ExecUnique(Unique *node)
*/ */
bool isNull1, bool isNull1,
isNull2; isNull2;
char *attr1, Datum attr1,
*attr2; attr2;
char *val1, char *val1,
*val2; *val2;

View File

@ -319,7 +319,7 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
char * char *
SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
{ {
char *val; Datum val;
bool isnull; bool isnull;
Oid foutoid; Oid foutoid;
@ -346,10 +346,10 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
return (fmgr(foutoid, val, gettypelem(tupdesc->attrs[fnumber - 1]->atttypid))); return (fmgr(foutoid, val, gettypelem(tupdesc->attrs[fnumber - 1]->atttypid)));
} }
char * Datum
SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull) SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
{ {
char *val; Datum val;
*isnull = true; *isnull = true;
SPI_result = 0; SPI_result = 0;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.8 1997/09/08 21:43:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.9 1997/09/12 04:07:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -213,7 +213,7 @@ void
be_printtup(HeapTuple tuple, TupleDesc typeinfo) be_printtup(HeapTuple tuple, TupleDesc typeinfo)
{ {
int i; int i;
char *attr; Datum attr;
bool isnull; bool isnull;
Oid typoutput; Oid typoutput;

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.25 1997/09/08 21:46:04 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.26 1997/09/12 04:07:56 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1378,8 +1378,8 @@ findsupers(Oid relid, Oid **supervec)
{ {
qentry = (SuperQE *) palloc(sizeof(SuperQE)); qentry = (SuperQE *) palloc(sizeof(SuperQE));
d = (Datum) fastgetattr(inhtup, Anum_pg_inherits_inhparent, d = fastgetattr(inhtup, Anum_pg_inherits_inhparent,
inhtupdesc, &isNull); inhtupdesc, &isNull);
qentry->sqe_relid = DatumGetObjectId(d); qentry->sqe_relid = DatumGetObjectId(d);
/* put this one on the queue */ /* put this one on the queue */

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.25 1997/09/08 21:46:12 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.26 1997/09/12 04:08:01 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -230,7 +230,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
case T_Integer: case T_Integer:
const_string = (char *) palloc(256); const_string = (char *) palloc(256);
string_palloced = true; string_palloced = true;
sprintf(const_string, "%d", expr->val.ival); sprintf(const_string, "%ld", expr->val.ival);
break; break;
default: default:
elog(WARN, elog(WARN,
@ -405,7 +405,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
case CASHOID: /* money */ case CASHOID: /* money */
const_string = (char *) palloc(256); const_string = (char *) palloc(256);
string_palloced = true; string_palloced = true;
sprintf(const_string, "%d", sprintf(const_string, "%ld",
(long) ((Const *) expr)->constvalue); (long) ((Const *) expr)->constvalue);
break; break;
case TEXTOID: /* text */ case TEXTOID: /* text */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.4 1997/09/08 02:28:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.5 1997/09/12 04:08:06 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -109,11 +109,11 @@ RemoveRewriteRule(char *ruleName)
*/ */
ruleId = tuple->t_oid; ruleId = tuple->t_oid;
eventRelationOidDatum = eventRelationOidDatum =
PointerGetDatum(heap_getattr(tuple, heap_getattr(tuple,
buffer, buffer,
Anum_pg_rewrite_ev_class, Anum_pg_rewrite_ev_class,
RelationGetTupleDescriptor(RewriteRelation), RelationGetTupleDescriptor(RewriteRelation),
&isNull)); &isNull);
if (isNull) if (isNull)
{ {
/* XXX strange!!! */ /* XXX strange!!! */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.9 1997/09/08 21:46:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.10 1997/09/12 04:08:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -58,14 +58,14 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
if (ruletuple == NULL) if (ruletuple == NULL)
elog(WARN, "rule %u isn't in rewrite system relation", ruleoid); elog(WARN, "rule %u isn't in rewrite system relation", ruleoid);
ruleaction = heap_getattr(ruletuple, ruleaction = (char *)heap_getattr(ruletuple,
InvalidBuffer, InvalidBuffer,
Anum_pg_rewrite_action, Anum_pg_rewrite_action,
ruleTupdesc, ruleTupdesc,
&action_is_null); &action_is_null);
rule_evqual_string = heap_getattr(ruletuple, InvalidBuffer, rule_evqual_string = (char *)heap_getattr(ruletuple, InvalidBuffer,
Anum_pg_rewrite_ev_qual, Anum_pg_rewrite_ev_qual,
ruleTupdesc, &action_is_null); ruleTupdesc, &action_is_null);
*instead_flag = !!heap_getattr(ruletuple, InvalidBuffer, *instead_flag = !!heap_getattr(ruletuple, InvalidBuffer,
Anum_pg_rewrite_is_instead, Anum_pg_rewrite_is_instead,
ruleTupdesc, &instead_is_null); ruleTupdesc, &instead_is_null);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.17 1997/09/08 21:47:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.18 1997/09/12 04:08:15 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -472,7 +472,7 @@ inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes)
} }
/* copy the data from this block into the buffer */ /* copy the data from this block into the buffer */
d = (Datum) heap_getattr(htup, b, 2, obj_desc->hdesc, &isNull); d = heap_getattr(htup, b, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d); fsblock = (struct varlena *) DatumGetPointer(d);
off = obj_desc->offset - obj_desc->lowbyte; off = obj_desc->offset - obj_desc->lowbyte;
@ -648,9 +648,9 @@ inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP)
* return the tuple. * return the tuple.
*/ */
d = (Datum) heap_getattr(htup, *bufP, 1, obj_desc->hdesc, &isNull); d = heap_getattr(htup, *bufP, 1, obj_desc->hdesc, &isNull);
lastbyte = (int32) DatumGetInt32(d); lastbyte = (int32) DatumGetInt32(d);
d = (Datum) heap_getattr(htup, *bufP, 2, obj_desc->hdesc, &isNull); d = heap_getattr(htup, *bufP, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d); fsblock = (struct varlena *) DatumGetPointer(d);
/* /*
@ -817,7 +817,7 @@ inv_wrold(LargeObjectDesc *obj_desc,
newpage = BufferGetPage(newbuf); newpage = BufferGetPage(newbuf);
hr = obj_desc->heap_r; hr = obj_desc->heap_r;
freespc = IFREESPC(page); freespc = IFREESPC(page);
d = (Datum) heap_getattr(htup, buffer, 2, obj_desc->hdesc, &isNull); d = heap_getattr(htup, buffer, 2, obj_desc->hdesc, &isNull);
fsblock = (struct varlena *) DatumGetPointer(d); fsblock = (struct varlena *) DatumGetPointer(d);
tupbytes = fsblock->vl_len - sizeof(fsblock->vl_len); tupbytes = fsblock->vl_len - sizeof(fsblock->vl_len);
@ -1218,7 +1218,7 @@ _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln)
index_endscan(iscan); index_endscan(iscan);
/* get olastbyte attribute */ /* get olastbyte attribute */
d = (Datum) heap_getattr(htup, buf, 1, hdesc, &isNull); d = heap_getattr(htup, buf, 1, hdesc, &isNull);
size = DatumGetInt32(d) + 1; size = DatumGetInt32(d) + 1;
/* wei hates it if you forget to do this */ /* wei hates it if you forget to do this */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.5 1997/09/08 02:30:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.6 1997/09/12 04:08:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -82,11 +82,11 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
current_tuple != NULL && retval; current_tuple != NULL && retval;
current_tuple = heap_getnext(scan_descriptor, 0, NULL)) current_tuple = heap_getnext(scan_descriptor, 0, NULL))
{ {
value = PointerGetDatum(heap_getattr(current_tuple, value = heap_getattr(current_tuple,
InvalidBuffer, InvalidBuffer,
(AttrNumber) attrid, (AttrNumber) attrid,
RelationGetTupleDescriptor(relation_to_scan), RelationGetTupleDescriptor(relation_to_scan),
&dummy)); &dummy);
integer_value = DatumGetInt16(value); integer_value = DatumGetInt16(value);
if (left_side_argument == integer_value) if (left_side_argument == integer_value)

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.13 1997/09/08 21:48:45 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.14 1997/09/12 04:08:28 momjian Exp $
* *
* Notes: * Notes:
* XXX This needs to use exception.h to handle recovery when * XXX This needs to use exception.h to handle recovery when
@ -387,40 +387,40 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
cacheInOutP->cc_skey[3].sk_argument = cacheInOutP->cc_skey[3].sk_argument =
(cacheInOutP->cc_key[3] == ObjectIdAttributeNumber) (cacheInOutP->cc_key[3] == ObjectIdAttributeNumber)
? (Datum) tuple->t_oid ? (Datum) tuple->t_oid
: (Datum) fastgetattr(tuple, : fastgetattr(tuple,
cacheInOutP->cc_key[3], cacheInOutP->cc_key[3],
RelationGetTupleDescriptor(relation), RelationGetTupleDescriptor(relation),
&isNull); &isNull);
Assert(!isNull); Assert(!isNull);
/* FALLTHROUGH */ /* FALLTHROUGH */
case 3: case 3:
cacheInOutP->cc_skey[2].sk_argument = cacheInOutP->cc_skey[2].sk_argument =
(cacheInOutP->cc_key[2] == ObjectIdAttributeNumber) (cacheInOutP->cc_key[2] == ObjectIdAttributeNumber)
? (Datum) tuple->t_oid ? (Datum) tuple->t_oid
: (Datum) fastgetattr(tuple, : fastgetattr(tuple,
cacheInOutP->cc_key[2], cacheInOutP->cc_key[2],
RelationGetTupleDescriptor(relation), RelationGetTupleDescriptor(relation),
&isNull); &isNull);
Assert(!isNull); Assert(!isNull);
/* FALLTHROUGH */ /* FALLTHROUGH */
case 2: case 2:
cacheInOutP->cc_skey[1].sk_argument = cacheInOutP->cc_skey[1].sk_argument =
(cacheInOutP->cc_key[1] == ObjectIdAttributeNumber) (cacheInOutP->cc_key[1] == ObjectIdAttributeNumber)
? (Datum) tuple->t_oid ? (Datum) tuple->t_oid
: (Datum) fastgetattr(tuple, : fastgetattr(tuple,
cacheInOutP->cc_key[1], cacheInOutP->cc_key[1],
RelationGetTupleDescriptor(relation), RelationGetTupleDescriptor(relation),
&isNull); &isNull);
Assert(!isNull); Assert(!isNull);
/* FALLTHROUGH */ /* FALLTHROUGH */
case 1: case 1:
cacheInOutP->cc_skey[0].sk_argument = cacheInOutP->cc_skey[0].sk_argument =
(cacheInOutP->cc_key[0] == ObjectIdAttributeNumber) (cacheInOutP->cc_key[0] == ObjectIdAttributeNumber)
? (Datum) tuple->t_oid ? (Datum) tuple->t_oid
: (Datum) fastgetattr(tuple, : fastgetattr(tuple,
cacheInOutP->cc_key[0], cacheInOutP->cc_key[0],
RelationGetTupleDescriptor(relation), RelationGetTupleDescriptor(relation),
&isNull); &isNull);
Assert(!isNull); Assert(!isNull);
break; break;
default: default:

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.7 1997/09/08 21:48:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.8 1997/09/12 04:08:35 momjian Exp $
* *
* NOTES * NOTES
* These routines allow the parser/planner/executor to perform * These routines allow the parser/planner/executor to perform
@ -494,7 +494,7 @@ SearchSysCacheGetAttribute(int cacheId,
int32 attributeLength, int32 attributeLength,
attributeByValue; attributeByValue;
bool isNull; bool isNull;
char *attributeValue; Datum attributeValue;
void *returnValue; void *returnValue;
tp = SearchSysCacheTuple(cacheId, key1, key2, key3, key4); tp = SearchSysCacheTuple(cacheId, key1, key2, key3, key4);
@ -562,7 +562,7 @@ SearchSysCacheGetAttribute(int cacheId,
: attributeLength; /* fixed length */ : attributeLength; /* fixed length */
tmp = (char *) palloc(size); tmp = (char *) palloc(size);
memmove(tmp, attributeValue, size); memmove(tmp, (void *)attributeValue, size);
returnValue = (void *) tmp; returnValue = (void *) tmp;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.11 1997/09/08 02:31:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.12 1997/09/12 04:08:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -53,9 +53,9 @@ fmgr_dynamic(Oid procedureId, int *pronargs)
{ {
HeapTuple procedureTuple; HeapTuple procedureTuple;
Form_pg_proc procedureStruct; Form_pg_proc procedureStruct;
char *proname; char *proname,
char *probinattr,
*probinstring; *probinstring;
Datum probinattr;
func_ptr user_fn; func_ptr user_fn;
Relation rdesc; Relation rdesc;
bool isnull; bool isnull;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.7 1997/09/08 02:32:25 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.8 1997/09/12 04:08:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -197,8 +197,8 @@ puttuple(struct leftist ** treep,
int int
tuplecmp(HeapTuple ltup, HeapTuple rtup, LeftistContext context) tuplecmp(HeapTuple ltup, HeapTuple rtup, LeftistContext context)
{ {
register char *lattr, register Datum lattr,
*rattr; rattr;
int nkey = 0; int nkey = 0;
int result = 0; int result = 0;
bool isnull; bool isnull;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.7 1997/09/08 21:49:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.8 1997/09/12 04:08:57 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -32,9 +32,11 @@ static AbsoluteTime TimeQualGetStartTime(TimeQual qual);
static bool TimeQualIncludesNow(TimeQual qual); static bool TimeQualIncludesNow(TimeQual qual);
static bool TimeQualIndicatesDisableValidityChecking(TimeQual qual); static bool TimeQualIndicatesDisableValidityChecking(TimeQual qual);
static bool TimeQualIsLegal(TimeQual qual); static bool TimeQualIsLegal(TimeQual qual);
#ifndef NO_ASSERT_CHECKING
static bool TimeQualIsRanged(TimeQual qual); static bool TimeQualIsRanged(TimeQual qual);
static bool TimeQualIsSnapshot(TimeQual qual);
static bool TimeQualIsValid(TimeQual qual); static bool TimeQualIsValid(TimeQual qual);
#endif
static bool TimeQualIsSnapshot(TimeQual qual);
/* /*
* TimeQualMode -- * TimeQualMode --
@ -133,6 +135,7 @@ HeapTupleSatisfiesUpperUnboundedInternalTimeQual(HeapTuple tuple,
* TimeQualIsValid -- * TimeQualIsValid --
* True iff time qualification is valid. * True iff time qualification is valid.
*/ */
#ifndef NO_ASSERT_CHECKING
static bool static bool
TimeQualIsValid(TimeQual qual) TimeQualIsValid(TimeQual qual)
{ {
@ -179,6 +182,7 @@ TimeQualIsValid(TimeQual qual)
} }
return (true); return (true);
} }
#endif
/* /*
* TimeQualIsLegal -- * TimeQualIsLegal --
@ -332,6 +336,7 @@ TimeQualIsSnapshot(TimeQual qual)
* Note: * Note:
* Assumes time qualification is valid. * Assumes time qualification is valid.
*/ */
#ifndef NO_ASSERT_CHECKING
static bool static bool
TimeQualIsRanged(TimeQual qual) TimeQualIsRanged(TimeQual qual)
{ {
@ -344,6 +349,7 @@ TimeQualIsRanged(TimeQual qual)
return ((bool) !(((InternalTimeQual) qual)->mode & TimeQualAt)); return ((bool) !(((InternalTimeQual) qual)->mode & TimeQualAt));
} }
#endif
/* /*
* TimeQualIndicatesDisableValidityChecking -- * TimeQualIndicatesDisableValidityChecking --

View File

@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: heapam.h,v 1.15 1997/09/08 21:50:45 momjian Exp $ * $Id: heapam.h,v 1.16 1997/09/12 04:09:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -97,11 +97,11 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
#define heap_getattr(tup, b, attnum, tupleDesc, isnull) \ #define heap_getattr(tup, b, attnum, tupleDesc, isnull) \
(AssertMacro((tup) != NULL) ? \ (AssertMacro((tup) != NULL) ? \
((attnum) > (int) (tup)->t_natts) ? \ ((attnum) > (int) (tup)->t_natts) ? \
(((isnull) ? (*(isnull) = true) : (char)NULL), (char *)NULL) : \ (((isnull) ? (*(isnull) = true) : (char)NULL), (Datum)NULL) : \
((attnum) > 0) ? \ ((attnum) > 0) ? \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \ fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
(((isnull) ? (*(isnull) = false) : (char)NULL), heap_getsysattr((tup), (b), (attnum))) : \ (((isnull) ? (*(isnull) = false) : (char)NULL), heap_getsysattr((tup), (b), (attnum))) : \
(char *)NULL) (Datum)NULL)
extern HeapAccessStatistics heap_access_stats; /* in stats.c */ extern HeapAccessStatistics heap_access_stats; /* in stats.c */
@ -143,10 +143,9 @@ DataFill(char *data, TupleDesc tupleDesc,
extern int heap_attisnull(HeapTuple tup, int attnum); extern int heap_attisnull(HeapTuple tup, int attnum);
extern int heap_sysattrlen(AttrNumber attno); extern int heap_sysattrlen(AttrNumber attno);
extern bool heap_sysattrbyval(AttrNumber attno); extern bool heap_sysattrbyval(AttrNumber attno);
extern char *heap_getsysattr(HeapTuple tup, Buffer b, int attnum); extern Datum heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
extern char * extern Datum fastgetattr(HeapTuple tup, int attnum,
fastgetattr(HeapTuple tup, int attnum, TupleDesc att, bool *isnull);
TupleDesc att, bool *isnull);
extern HeapTuple heap_copytuple(HeapTuple tuple); extern HeapTuple heap_copytuple(HeapTuple tuple);
extern HeapTuple extern HeapTuple
heap_formtuple(TupleDesc tupleDescriptor, heap_formtuple(TupleDesc tupleDescriptor,

View File

@ -80,7 +80,7 @@ extern void *SPI_saveplan(void *plan);
extern int SPI_fnumber(TupleDesc tupdesc, char *fname); extern int SPI_fnumber(TupleDesc tupdesc, char *fname);
extern char *SPI_fname(TupleDesc tupdesc, int fnumber); extern char *SPI_fname(TupleDesc tupdesc, int fnumber);
extern char *SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber); extern char *SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber);
extern char *SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull); extern Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull);
extern char *SPI_gettype(TupleDesc tupdesc, int fnumber); extern char *SPI_gettype(TupleDesc tupdesc, int fnumber);
extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber); extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber);
extern char *SPI_getrelname(Relation rel); extern char *SPI_getrelname(Relation rel);