1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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

@ -7,7 +7,7 @@
*
*
* 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;
tupType = (TupleDesc) junkfilter->jf_tupType;
*value = (Datum)
heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
*value = heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
return true;
}
@ -391,10 +390,8 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
*/
for (i = 0; i < cleanLength; i++)
{
Datum d = (Datum)
heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
values[i] = d;
values[i] =
heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
if (isNull)
nulls[i] = 'n';

View File

@ -7,7 +7,7 @@
*
*
* 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;
}
result = (Datum)
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? */
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? */
/* ----------------
* return null if att is null
@ -530,12 +529,11 @@ GetAttributeByNum(TupleTableSlot *slot,
return (char *) NULL;
}
retval = (Datum)
heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
slot->ttc_tupleDescriptor,
isNull);
retval = heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
slot->ttc_tupleDescriptor,
isNull);
if (*isNull)
return (char *) NULL;
return (char *) retval;
@ -595,12 +593,11 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
if (attrno == InvalidAttrNumber)
elog(WARN, "GetAttributeByName: attribute %s not found", attname);
retval = (Datum)
heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
tupdesc,
isNull);
retval = heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
tupdesc,
isNull);
if (*isNull)
return (char *) NULL;
return (char *) retval;

View File

@ -8,7 +8,7 @@
*
*
* 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;
val = PointerGetDatum(heap_getattr(tup,
InvalidBuffer,
attrno,
TD,
isnullP));
val = heap_getattr(tup, InvalidBuffer, attrno, TD, isnullP);
if (*isnullP)
return (Datum) NULL;

View File

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

View File

@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* 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,
isNull2;
char *attr1,
*attr2;
Datum attr1,
attr2;
char *val1,
*val2;
int i;

View File

@ -7,7 +7,7 @@
*
*
* 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,
isNull2;
char *attr1,
*attr2;
Datum attr1,
attr2;
char *val1,
*val2;

View File

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