1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Revert "Convert *GetDatum() and DatumGet*() macros to inline functions"

This reverts commit 595836e99b.

It has problems when USE_FLOAT8_BYVAL is off.
This commit is contained in:
Peter Eisentraut
2022-09-12 19:57:07 +02:00
parent 595836e99b
commit e8d78581bb
27 changed files with 190 additions and 659 deletions

View File

@ -111,27 +111,12 @@ typedef TSVectorData *TSVector;
#define POSDATAPTR(x,e) (_POSVECPTR(x,e)->pos)
/*
* fmgr interface functions
* fmgr interface macros
*/
static inline TSVector
DatumGetTSVector(Datum X)
{
return (TSVector) PG_DETOAST_DATUM(X);
}
static inline TSVector
DatumGetTSVectorCopy(Datum X)
{
return (TSVector) PG_DETOAST_DATUM_COPY(X);
}
static inline Datum
TSVectorGetDatum(const TSVectorData *X)
{
return PointerGetDatum(X);
}
#define DatumGetTSVector(X) ((TSVector) PG_DETOAST_DATUM(X))
#define DatumGetTSVectorCopy(X) ((TSVector) PG_DETOAST_DATUM_COPY(X))
#define TSVectorGetDatum(X) PointerGetDatum(X)
#define PG_GETARG_TSVECTOR(n) DatumGetTSVector(PG_GETARG_DATUM(n))
#define PG_GETARG_TSVECTOR_COPY(n) DatumGetTSVectorCopy(PG_GETARG_DATUM(n))
#define PG_RETURN_TSVECTOR(x) return TSVectorGetDatum(x)
@ -242,29 +227,14 @@ typedef TSQueryData *TSQuery;
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((TSQuery)(x))->size * sizeof(QueryItem) )
/*
* fmgr interface functions
* fmgr interface macros
* Note, TSQuery type marked as plain storage, so it can't be toasted
* but PG_DETOAST_DATUM_COPY is used for simplicity
*/
static inline TSQuery
DatumGetTSQuery(Datum X)
{
return (TSQuery) DatumGetPointer(X);
}
static inline TSQuery
DatumGetTSQueryCopy(Datum X)
{
return (TSQuery) PG_DETOAST_DATUM_COPY(X);
}
static inline Datum
TSQueryGetDatum(const TSQueryData *X)
{
return PointerGetDatum(X);
}
#define DatumGetTSQuery(X) ((TSQuery) DatumGetPointer(X))
#define DatumGetTSQueryCopy(X) ((TSQuery) PG_DETOAST_DATUM_COPY(X))
#define TSQueryGetDatum(X) PointerGetDatum(X)
#define PG_GETARG_TSQUERY(n) DatumGetTSQuery(PG_GETARG_DATUM(n))
#define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n))
#define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x)

View File

@ -243,18 +243,8 @@ typedef uint64 TSQuerySign;
#define TSQS_SIGLEN (sizeof(TSQuerySign)*BITS_PER_BYTE)
static inline Datum
TSQuerySignGetDatum(TSQuerySign X)
{
return Int64GetDatum((int64) X);
}
static inline TSQuerySign
DatumGetTSQuerySign(Datum X)
{
return (TSQuerySign) DatumGetInt64(X);
}
#define TSQuerySignGetDatum(X) Int64GetDatum((int64) (X))
#define DatumGetTSQuerySign(X) ((TSQuerySign) DatumGetInt64(X))
#define PG_RETURN_TSQUERYSIGN(X) return TSQuerySignGetDatum(X)
#define PG_GETARG_TSQUERYSIGN(n) DatumGetTSQuerySign(PG_GETARG_DATUM(n))