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")));
104 size = (
Size) (strlen(s) + 1);
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);
291 result = (value1 == value2);
301 else if (typLen == -1)
327 else if (typLen == -2)
335 len1 = strlen(
s1) + 1;
336 len2 = strlen(
s2) + 1;
342 elog(
ERROR,
"unexpected typLen: %d", typLen);
383 else if (typLen == -1)
397 else if (typLen == -2)
408 elog(
ERROR,
"unexpected typLen: %d", typLen);
452 Size sz =
sizeof(int);
459 else if (typLen == -1 &&
498 char **start_address)
508 else if (typLen == -1 &&
516 memcpy(*start_address, &header,
sizeof(
int));
517 *start_address +=
sizeof(int);
525 *start_address +=
sizeof(
Datum);
535 tmp = (
char *)
palloc(header);
537 memcpy(*start_address, tmp, header);
538 *start_address += header;
546 *start_address += header;
565 memcpy(&header, *start_address,
sizeof(
int));
566 *start_address +=
sizeof(int);
584 *start_address +=
sizeof(
Datum);
591 memcpy(d, *start_address, header);
592 *start_address += header;
#define Assert(condition)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
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)
Size toast_raw_datum_size(Datum value)
int errcode(int sqlerrcode)
#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 Datum Int16GetDatum(int16 X)
static char * DatumGetCString(Datum X)
static Pointer DatumGetPointer(Datum X)
static char DatumGetChar(Datum X)
static Datum Int32GetDatum(int32 X)
static int16 DatumGetInt16(Datum X)
static int32 DatumGetInt32(Datum X)
static Datum CharGetDatum(char X)
static Size VARSIZE_ANY(const void *PTR)
static bool VARATT_IS_EXTERNAL_EXPANDED_RW(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
static bool VARATT_IS_EXTERNAL_EXPANDED(const void *PTR)