PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/tupmacs.h"
#include "utils/array.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
Go to the source code of this file.
Functions | |
static Size | EA_get_flat_size (ExpandedObjectHeader *eohptr) |
static void | EA_flatten_into (ExpandedObjectHeader *eohptr, void *result, Size allocated_size) |
static void | copy_byval_expanded_array (ExpandedArrayHeader *eah, ExpandedArrayHeader *oldeah) |
Datum | expand_array (Datum arraydatum, MemoryContext parentcontext, ArrayMetaState *metacache) |
ExpandedArrayHeader * | DatumGetExpandedArray (Datum d) |
ExpandedArrayHeader * | DatumGetExpandedArrayX (Datum d, ArrayMetaState *metacache) |
AnyArrayType * | DatumGetAnyArrayP (Datum d) |
void | deconstruct_expanded_array (ExpandedArrayHeader *eah) |
Variables | |
static const ExpandedObjectMethods | EA_methods |
|
static |
Definition at line 185 of file array_expanded.c.
References ExpandedArrayHeader::dims, ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, ExpandedArrayHeader::dvalueslen, ExpandedArrayHeader::element_type, ExpandedObjectHeader::eoh_context, ExpandedArrayHeader::fendptr, ExpandedArrayHeader::flat_size, ExpandedArrayHeader::fstartptr, ExpandedArrayHeader::fvalue, ExpandedArrayHeader::hdr, ExpandedArrayHeader::lbound, MemoryContextAlloc(), ExpandedArrayHeader::ndims, ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, ExpandedArrayHeader::typbyval, and ExpandedArrayHeader::typlen.
Referenced by expand_array().
AnyArrayType* DatumGetAnyArrayP | ( | Datum | d | ) |
Definition at line 401 of file array_expanded.c.
References Assert, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, PG_DETOAST_DATUM, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by array_map().
ExpandedArrayHeader* DatumGetExpandedArray | ( | Datum | d | ) |
Definition at line 352 of file array_expanded.c.
References Assert, CurrentMemoryContext, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, expand_array(), and VARATT_IS_EXTERNAL_EXPANDED_RW.
Referenced by array_set_element_expanded(), and statext_expressions_load().
ExpandedArrayHeader* DatumGetExpandedArrayX | ( | Datum | d, |
ArrayMetaState * | metacache | ||
) |
Definition at line 372 of file array_expanded.c.
References Assert, CurrentMemoryContext, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, ExpandedArrayHeader::element_type, ArrayMetaState::element_type, expand_array(), ExpandedArrayHeader::typalign, ArrayMetaState::typalign, ExpandedArrayHeader::typbyval, ArrayMetaState::typbyval, ExpandedArrayHeader::typlen, ArrayMetaState::typlen, and VARATT_IS_EXTERNAL_EXPANDED_RW.
void deconstruct_expanded_array | ( | ExpandedArrayHeader * | eah | ) |
Definition at line 424 of file array_expanded.c.
References ARR_HASNULL, deconstruct_array(), ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, ExpandedArrayHeader::dvalueslen, ExpandedArrayHeader::element_type, ExpandedObjectHeader::eoh_context, ExpandedArrayHeader::fvalue, ExpandedArrayHeader::hdr, MemoryContextSwitchTo(), ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, ExpandedArrayHeader::typbyval, and ExpandedArrayHeader::typlen.
Referenced by array_contain_compare(), array_get_element_expanded(), array_set_element_expanded(), and statext_expressions_load().
|
static |
Definition at line 293 of file array_expanded.c.
References ARR_DIMS, ARR_LBOUND, ARR_OVERHEAD_WITHNULLS, ARR_SIZE, Assert, CopyArrayEls(), ArrayType::dataoffset, ExpandedArrayHeader::dims, ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, EA_MAGIC, ExpandedArrayHeader::ea_magic, ExpandedArrayHeader::element_type, ArrayType::elemtype, ExpandedArrayHeader::flat_size, ExpandedArrayHeader::fvalue, ExpandedArrayHeader::lbound, ArrayType::ndim, ExpandedArrayHeader::ndims, ExpandedArrayHeader::nelems, SET_VARSIZE, ExpandedArrayHeader::typalign, ExpandedArrayHeader::typbyval, and ExpandedArrayHeader::typlen.
|
static |
Definition at line 233 of file array_expanded.c.
References AllocSizeIsValid, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, ARR_SIZE, ArrayGetNItems(), Assert, att_addlength_datum, att_align_nominal, ExpandedArrayHeader::dims, ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, EA_MAGIC, ExpandedArrayHeader::ea_magic, ereport, errcode(), errmsg(), ERROR, ExpandedArrayHeader::flat_size, ExpandedArrayHeader::fvalue, i, MaxAllocSize, ExpandedArrayHeader::ndims, ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, and ExpandedArrayHeader::typlen.
Datum expand_array | ( | Datum | arraydatum, |
MemoryContext | parentcontext, | ||
ArrayMetaState * | metacache | ||
) |
Definition at line 50 of file array_expanded.c.
References ALLOCSET_START_SMALL_SIZES, AllocSetContextCreate, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_SIZE, Assert, copy_byval_expanded_array(), DatumGetArrayTypePCopy, DatumGetEOHP(), DatumGetPointer(), ExpandedArrayHeader::dims, ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, ExpandedArrayHeader::dvalueslen, EA_MAGIC, ExpandedArrayHeader::ea_magic, EA_methods, ExpandedArrayHeader::element_type, ArrayMetaState::element_type, EOH_init_header(), EOHPGetRWDatum(), ExpandedArrayHeader::fendptr, ExpandedArrayHeader::flat_size, ExpandedArrayHeader::fstartptr, ExpandedArrayHeader::fvalue, get_typlenbyvalalign(), ExpandedArrayHeader::hdr, ExpandedArrayHeader::lbound, MemoryContextAlloc(), MemoryContextSwitchTo(), ExpandedArrayHeader::ndims, ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, ArrayMetaState::typalign, ExpandedArrayHeader::typbyval, ArrayMetaState::typbyval, ExpandedArrayHeader::typlen, ArrayMetaState::typlen, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by construct_empty_expanded_array(), DatumGetExpandedArray(), DatumGetExpandedArrayX(), exec_assign_value(), and plpgsql_exec_function().
|
static |
Definition at line 28 of file array_expanded.c.
Referenced by expand_array().