aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execQual.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-24 23:34:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-24 23:34:11 +0000
commit481487b9647c02b83a7701a0b513e9437c380ccd (patch)
treef3ab3d5858926e19bc2889a8ef730e28e511866a /src/backend/executor/execQual.c
parentd9eb7d8fa1b841da4799b907ac2d97f8bcf5cf87 (diff)
downloadpostgresql-481487b9647c02b83a7701a0b513e9437c380ccd.tar.gz
postgresql-481487b9647c02b83a7701a0b513e9437c380ccd.zip
GetAttributeByName and GetAttributeByNum should be declared to return
Datum, not char*, for portability's sake.
Diffstat (limited to 'src/backend/executor/execQual.c')
-rw-r--r--src/backend/executor/execQual.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 3929c8782a9..622ea2ef82c 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.79 2000/08/24 03:29:03 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.80 2000/08/24 23:34:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -502,13 +502,8 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
* named attribute out of the tuple from the arg slot. User defined
* C functions which take a tuple as an argument are expected
* to use this. Ex: overpaid(EMP) might call GetAttributeByNum().
- *
- * XXX these two functions are misdeclared: they should be declared to
- * return Datum. They are not used anywhere in the backend proper, and
- * exist only for use by user-defined functions. Should we change their
- * definitions, at risk of breaking user code?
*/
-char *
+Datum
GetAttributeByNum(TupleTableSlot *slot,
AttrNumber attrno,
bool *isNull)
@@ -527,7 +522,7 @@ GetAttributeByNum(TupleTableSlot *slot,
if (TupIsNull(slot))
{
*isNull = true;
- return (char *) NULL;
+ return (Datum) 0;
}
retval = heap_getattr(slot->val,
@@ -535,11 +530,12 @@ GetAttributeByNum(TupleTableSlot *slot,
slot->ttc_tupleDescriptor,
isNull);
if (*isNull)
- return (char *) NULL;
- return (char *) retval;
+ return (Datum) 0;
+
+ return retval;
}
-char *
+Datum
GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
{
AttrNumber attrno;
@@ -557,7 +553,7 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
if (TupIsNull(slot))
{
*isNull = true;
- return (char *) NULL;
+ return (Datum) 0;
}
tupdesc = slot->ttc_tupleDescriptor;
@@ -581,8 +577,9 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
tupdesc,
isNull);
if (*isNull)
- return (char *) NULL;
- return (char *) retval;
+ return (Datum) 0;
+
+ return retval;
}
/*