50#include "utils/fmgrprotos.h"
82 else if (typLen == -1)
89 (
errcode(ERRCODE_DATA_EXCEPTION),
90 errmsg(
"invalid Datum pointer")));
94 else if (typLen == -2)
101 (
errcode(ERRCODE_DATA_EXCEPTION),
102 errmsg(
"invalid Datum pointer")));
108 elog(
ERROR,
"invalid typLen: %d", typLen);
138 else if (typLen == -1)
151 resultptr = (
char *)
palloc(resultsize);
162 resultptr = (
char *)
palloc(realSize);
163 memcpy(resultptr, vl, realSize);
175 resultptr = (
char *)
palloc(realSize);
196 if (!typByVal && typLen == -1 &&
235 res = (value1 == value2);
253 res = (memcmp(
s1,
s2, size1) == 0);
274 result = (value1 == value2);
282 else if (typLen == -1)
308 else if (typLen == -2)
316 len1 = strlen(
s1) + 1;
317 len2 = strlen(
s2) + 1;
320 result = (memcmp(
s1,
s2, len1) == 0);
323 elog(
ERROR,
"unexpected typLen: %d", typLen);
347 else if (typLen == -1)
361 else if (typLen == -2)
372 elog(
ERROR,
"unexpected typLen: %d", typLen);
414 Size sz =
sizeof(int);
421 else if (typLen == -1 &&
460 char **start_address)
470 else if (typLen == -1 &&
478 memcpy(*start_address, &header,
sizeof(
int));
479 *start_address +=
sizeof(int);
486 memcpy(*start_address, &
value,
sizeof(
Datum));
487 *start_address +=
sizeof(
Datum);
497 tmp = (
char *)
palloc(header);
499 memcpy(*start_address, tmp, header);
500 *start_address += header;
508 *start_address += header;
527 memcpy(&header, *start_address,
sizeof(
int));
528 *start_address +=
sizeof(int);
545 memcpy(&
val, *start_address,
sizeof(
Datum));
546 *start_address +=
sizeof(
Datum);
553 memcpy(d, *start_address, header);
554 *start_address += header;
#define Assert(condition)
#define PointerIsValid(pointer)
Datum datumCopy(Datum value, bool typByVal, int typLen)
Datum btequalimage(PG_FUNCTION_ARGS)
Datum datumTransfer(Datum value, bool typByVal, int typLen)
Size datumGetSize(Datum value, bool typByVal, int typLen)
uint32 datum_image_hash(Datum value, bool typByVal, int typLen)
Datum datumRestore(char **start_address, bool *isnull)
void datumSerialize(Datum value, bool isnull, bool typByVal, int typLen, char **start_address)
Size datumEstimateSpace(Datum value, bool isnull, bool typByVal, int typLen)
bool datum_image_eq(Datum value1, Datum value2, bool typByVal, int typLen)
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
static void PGresult * res
Size toast_raw_datum_size(Datum value)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
Datum TransferExpandedObject(Datum d, MemoryContext new_parent)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
#define PG_DETOAST_DATUM_PACKED(datum)
#define PG_RETURN_BOOL(x)
uint32 hash_bytes(const unsigned char *k, int keylen)
void pfree(void *pointer)
MemoryContext CurrentMemoryContext
static Datum PointerGetDatum(const void *X)
static char * DatumGetCString(Datum X)
static Pointer DatumGetPointer(Datum X)
static pg_noinline void Size size
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define VARATT_IS_EXTERNAL_EXPANDED_RW(PTR)