mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
heapattr functions now return a Datum, not char *.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 = heap_getnext(scan_descriptor, 0, NULL))
|
||||
{
|
||||
value = PointerGetDatum(heap_getattr(current_tuple,
|
||||
InvalidBuffer,
|
||||
(AttrNumber) attrid,
|
||||
RelationGetTupleDescriptor(relation_to_scan),
|
||||
&dummy));
|
||||
value = heap_getattr(current_tuple,
|
||||
InvalidBuffer,
|
||||
(AttrNumber) attrid,
|
||||
RelationGetTupleDescriptor(relation_to_scan),
|
||||
&dummy);
|
||||
|
||||
integer_value = DatumGetInt16(value);
|
||||
if (left_side_argument == integer_value)
|
||||
|
||||
34
src/backend/utils/cache/catcache.c
vendored
34
src/backend/utils/cache/catcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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:
|
||||
* 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_key[3] == ObjectIdAttributeNumber)
|
||||
? (Datum) tuple->t_oid
|
||||
: (Datum) fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[3],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
: fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[3],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
Assert(!isNull);
|
||||
/* FALLTHROUGH */
|
||||
case 3:
|
||||
cacheInOutP->cc_skey[2].sk_argument =
|
||||
(cacheInOutP->cc_key[2] == ObjectIdAttributeNumber)
|
||||
? (Datum) tuple->t_oid
|
||||
: (Datum) fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[2],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
: fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[2],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
Assert(!isNull);
|
||||
/* FALLTHROUGH */
|
||||
case 2:
|
||||
cacheInOutP->cc_skey[1].sk_argument =
|
||||
(cacheInOutP->cc_key[1] == ObjectIdAttributeNumber)
|
||||
? (Datum) tuple->t_oid
|
||||
: (Datum) fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[1],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
: fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[1],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
Assert(!isNull);
|
||||
/* FALLTHROUGH */
|
||||
case 1:
|
||||
cacheInOutP->cc_skey[0].sk_argument =
|
||||
(cacheInOutP->cc_key[0] == ObjectIdAttributeNumber)
|
||||
? (Datum) tuple->t_oid
|
||||
: (Datum) fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[0],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
: fastgetattr(tuple,
|
||||
cacheInOutP->cc_key[0],
|
||||
RelationGetTupleDescriptor(relation),
|
||||
&isNull);
|
||||
Assert(!isNull);
|
||||
break;
|
||||
default:
|
||||
|
||||
6
src/backend/utils/cache/syscache.c
vendored
6
src/backend/utils/cache/syscache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@@ -494,7 +494,7 @@ SearchSysCacheGetAttribute(int cacheId,
|
||||
int32 attributeLength,
|
||||
attributeByValue;
|
||||
bool isNull;
|
||||
char *attributeValue;
|
||||
Datum attributeValue;
|
||||
void *returnValue;
|
||||
|
||||
tp = SearchSysCacheTuple(cacheId, key1, key2, key3, key4);
|
||||
@@ -562,7 +562,7 @@ SearchSysCacheGetAttribute(int cacheId,
|
||||
: attributeLength; /* fixed length */
|
||||
|
||||
tmp = (char *) palloc(size);
|
||||
memmove(tmp, attributeValue, size);
|
||||
memmove(tmp, (void *)attributeValue, size);
|
||||
returnValue = (void *) tmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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;
|
||||
Form_pg_proc procedureStruct;
|
||||
char *proname;
|
||||
char *probinattr,
|
||||
char *proname,
|
||||
*probinstring;
|
||||
Datum probinattr;
|
||||
func_ptr user_fn;
|
||||
Relation rdesc;
|
||||
bool isnull;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
tuplecmp(HeapTuple ltup, HeapTuple rtup, LeftistContext context)
|
||||
{
|
||||
register char *lattr,
|
||||
*rattr;
|
||||
register Datum lattr,
|
||||
rattr;
|
||||
int nkey = 0;
|
||||
int result = 0;
|
||||
bool isnull;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 TimeQualIndicatesDisableValidityChecking(TimeQual qual);
|
||||
static bool TimeQualIsLegal(TimeQual qual);
|
||||
#ifndef NO_ASSERT_CHECKING
|
||||
static bool TimeQualIsRanged(TimeQual qual);
|
||||
static bool TimeQualIsSnapshot(TimeQual qual);
|
||||
static bool TimeQualIsValid(TimeQual qual);
|
||||
#endif
|
||||
static bool TimeQualIsSnapshot(TimeQual qual);
|
||||
|
||||
/*
|
||||
* TimeQualMode --
|
||||
@@ -133,6 +135,7 @@ HeapTupleSatisfiesUpperUnboundedInternalTimeQual(HeapTuple tuple,
|
||||
* TimeQualIsValid --
|
||||
* True iff time qualification is valid.
|
||||
*/
|
||||
#ifndef NO_ASSERT_CHECKING
|
||||
static bool
|
||||
TimeQualIsValid(TimeQual qual)
|
||||
{
|
||||
@@ -179,6 +182,7 @@ TimeQualIsValid(TimeQual qual)
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TimeQualIsLegal --
|
||||
@@ -332,6 +336,7 @@ TimeQualIsSnapshot(TimeQual qual)
|
||||
* Note:
|
||||
* Assumes time qualification is valid.
|
||||
*/
|
||||
#ifndef NO_ASSERT_CHECKING
|
||||
static bool
|
||||
TimeQualIsRanged(TimeQual qual)
|
||||
{
|
||||
@@ -344,6 +349,7 @@ TimeQualIsRanged(TimeQual qual)
|
||||
|
||||
return ((bool) !(((InternalTimeQual) qual)->mode & TimeQualAt));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TimeQualIndicatesDisableValidityChecking --
|
||||
|
||||
Reference in New Issue
Block a user