81 else if (typLen == -1)
88 (
errcode(ERRCODE_DATA_EXCEPTION),
89 errmsg(
"invalid Datum pointer")));
93 else if (typLen == -2)
100 (
errcode(ERRCODE_DATA_EXCEPTION),
101 errmsg(
"invalid Datum pointer")));
103 size = (
Size) (strlen(s) + 1);
107 elog(
ERROR,
"invalid typLen: %d", typLen);
137 else if (typLen == -1)
150 resultptr = (
char *)
palloc(resultsize);
161 resultptr = (
char *)
palloc(realSize);
162 memcpy(resultptr, vl, realSize);
174 resultptr = (
char *)
palloc(realSize);
195 if (!typByVal && typLen == -1 &&
199 value =
datumCopy(value, typByVal, typLen);
234 res = (value1 == value2);
252 res = (memcmp(s1, s2, size1) == 0);
273 result = (value1 == value2);
281 else if (typLen == -1)
307 else if (typLen == -2)
315 len1 = strlen(s1) + 1;
316 len2 = strlen(s2) + 1;
319 result = (memcmp(s1, s2, len1) == 0);
322 elog(
ERROR,
"unexpected typLen: %d", typLen);
362 Size sz =
sizeof(int);
369 else if (typLen == -1 &&
408 char **start_address)
418 else if (typLen == -1 &&
426 memcpy(*start_address, &header,
sizeof(
int));
427 *start_address +=
sizeof(int);
434 memcpy(*start_address, &value,
sizeof(
Datum));
435 *start_address +=
sizeof(
Datum);
445 tmp = (
char *)
palloc(header);
447 memcpy(*start_address, tmp, header);
475 memcpy(&header, *start_address,
sizeof(
int));
476 *start_address +=
sizeof(int);
493 memcpy(&val, *start_address,
sizeof(
Datum));
494 *start_address +=
sizeof(
Datum);
501 memcpy(d, *start_address, header);
Datum btequalimage(PG_FUNCTION_ARGS)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define PointerGetDatum(X)
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
int errcode(int sqlerrcode)
Datum TransferExpandedObject(Datum d, MemoryContext new_parent)
void pfree(void *pointer)
#define DatumGetCString(X)
#define PG_DETOAST_DATUM_PACKED(datum)
MemoryContext CurrentMemoryContext
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
Size toast_raw_datum_size(Datum value)
Datum datumCopy(Datum value, bool typByVal, int typLen)
Size datumEstimateSpace(Datum value, bool isnull, bool typByVal, int typLen)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
#define PG_RETURN_BOOL(x)
Datum datumRestore(char **start_address, bool *isnull)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
#define ereport(elevel,...)
Datum datumTransfer(Datum value, bool typByVal, int typLen)
#define Assert(condition)
static void header(const char *fmt,...) pg_attribute_printf(1
#define DatumGetPointer(X)
int errmsg(const char *fmt,...)
void datumSerialize(Datum value, bool isnull, bool typByVal, int typLen, char **start_address)
#define VARATT_IS_EXTERNAL_EXPANDED_RW(PTR)
bool datum_image_eq(Datum value1, Datum value2, bool typByVal, int typLen)
Size datumGetSize(Datum value, bool typByVal, int typLen)
#define PointerIsValid(pointer)