26 void *result,
Size allocated_size);
89 if (metacache == NULL)
90 metacache = &fakecache;
189 int ndims = oldeah->
ndims;
198 memcpy(eah->
dims, oldeah->
dims, ndims *
sizeof(
int));
199 memcpy(eah->
lbound, oldeah->
lbound, ndims *
sizeof(
int));
209 dvalueslen *
sizeof(
Datum));
214 dvalueslen *
sizeof(
bool));
215 memcpy(eah->
dnulls, oldeah->
dnulls, dvalueslen *
sizeof(
bool));
264 for (
i = 0;
i < nelems;
i++)
266 if (dnulls && dnulls[
i])
273 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
274 errmsg(
"array size exceeds the maximum allowed (%d)",
294 void *result,
Size allocated_size)
308 memcpy(result, eah->
fvalue, allocated_size);
325 memset(aresult, 0, allocated_size);
328 aresult->
ndim = ndims;
331 memcpy(
ARR_DIMS(aresult), eah->
dims, ndims *
sizeof(
int));
#define DatumGetArrayTypePCopy(X)
#define ARR_OVERHEAD_WITHNULLS(ndims, nitems)
#define ARR_OVERHEAD_NONULLS(ndims)
static void copy_byval_expanded_array(ExpandedArrayHeader *eah, ExpandedArrayHeader *oldeah)
ExpandedArrayHeader * DatumGetExpandedArray(Datum d)
Datum expand_array(Datum arraydatum, MemoryContext parentcontext, ArrayMetaState *metacache)
ExpandedArrayHeader * DatumGetExpandedArrayX(Datum d, ArrayMetaState *metacache)
AnyArrayType * DatumGetAnyArrayP(Datum d)
void deconstruct_expanded_array(ExpandedArrayHeader *eah)
static Size EA_get_flat_size(ExpandedObjectHeader *eohptr)
static void EA_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
static const ExpandedObjectMethods EA_methods
void CopyArrayEls(ArrayType *array, Datum *values, bool *nulls, int nitems, int typlen, bool typbyval, char typalign, bool freedata)
void deconstruct_array(ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp)
int ArrayGetNItems(int ndim, const int *dims)
#define Assert(condition)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_init_header(ExpandedObjectHeader *eohptr, const ExpandedObjectMethods *methods, MemoryContext obj_context)
static Datum EOHPGetRWDatum(const struct ExpandedObjectHeader *eohptr)
#define PG_DETOAST_DATUM(datum)
void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign)
MemoryContext CurrentMemoryContext
void * MemoryContextAlloc(MemoryContext context, Size size)
#define AllocSetContextCreate
#define ALLOCSET_START_SMALL_SIZES
#define AllocSizeIsValid(size)
static Pointer DatumGetPointer(Datum X)
MemoryContextSwitchTo(old_ctx)
MemoryContext eoh_context
#define att_align_nominal(cur_offset, attalign)
#define att_addlength_datum(cur_offset, attlen, attdatum)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define VARATT_IS_EXTERNAL_EXPANDED_RW(PTR)
#define SET_VARSIZE(PTR, len)