80#define ATT_IS_PACKABLE(att) \
81 ((att)->attlen == -1 && (att)->attstorage != TYPSTORAGE_PLAIN)
83#define VARLENA_ATT_IS_PACKABLE(att) \
84 ((att)->attstorage != TYPSTORAGE_PLAIN)
87#define COMPACT_ATTR_IS_PACKABLE(att) \
88 ((att)->attlen == -1 && (att)->attispackable)
118 return entry1->
len >
entry2->len ? 1 : -1;
161 if (
att->atthasmissing)
190 key.len =
att->attlen;
223 Size data_length = 0;
247 else if (
atti->attlen == -1 &&
319 data_length =
att->attlen;
321 else if (
att->attlen == -1)
370 else if (
att->attlen == -2)
383 data_length =
att->attlen;
411#ifdef USE_ASSERT_CHECKING
439 isnull ? isnull[
i] :
true);
555 tp = (
char *) td + td->
t_hoff;
570 off +=
cattr->attlen;
581 off +=
cattr->attlen;
732 dest->t_len = src->
t_len;
733 dest->t_self = src->
t_self;
865 (*targetHeapTuple)->t_data
868 (*targetHeapTuple)->t_len =
len;
869 (*targetHeapTuple)->t_tableOid =
sourceTuple->t_tableOid;
883 targetData = (
char *) (*targetHeapTuple)->t_data + hoff;
893 (*targetMinimalTuple)->t_len =
len;
895 (*targetMinimalTuple)->t_infomask =
sourceTHeader->t_infomask;
902 infoMask = &((*targetMinimalTuple)->t_infomask);
1046 bool hasnull =
false;
1053 errmsg(
"number of columns (%d) exceeds limit (%d)",
1309 tp = (
char *)
tup +
tup->t_hoff;
1314#ifdef USE_ASSERT_CHECKING
1322 off =
cattr->attcacheoff;
1324#ifdef USE_ASSERT_CHECKING
1334 off +=
cattr->attlen;
1412 bool hasnull =
false;
1421 errmsg(
"number of columns (%d) exceeds limit (%d)",
1466 (
char *) tuple + hoff,
static Datum values[MAXATTR]
#define Assert(condition)
Datum datumCopy(Datum value, bool typByVal, int typLen)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
int errcode(int sqlerrcode)
#define ereport(elevel,...)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
#define palloc_array(type, count)
uint32 hash_bytes(const unsigned char *k, int keylen)
Datum toast_flatten_tuple_to_datum(HeapTupleHeader tup, uint32 tup_len, TupleDesc tupleDesc)
Size heap_compute_data_size(TupleDesc tupleDesc, const Datum *values, const bool *isnull)
static uint32 missing_hash(const void *key, Size keysize)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
HeapTuple heap_copytuple(HeapTuple tuple)
size_t varsize_any(void *p)
MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup, Size extra)
Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull, Size extra)
HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple, TupleDesc tupleDesc, int nCols, const int *replCols, const Datum *replValues, const bool *replIsnull)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_free_minimal_tuple(MinimalTuple mtup)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
Datum nocachegetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc)
Datum getmissingattr(TupleDesc tupleDesc, int attnum, bool *isnull)
MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup, Size extra)
HeapTuple heap_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc)
static void fill_val(CompactAttribute *att, bits8 **bit, int *bitmask, char **dataP, uint16 *infomask, Datum datum, bool isnull)
void heap_fill_tuple(TupleDesc tupleDesc, const Datum *values, const bool *isnull, char *data, Size data_size, uint16 *infomask, bits8 *bit)
#define COMPACT_ATTR_IS_PACKABLE(att)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
static void init_missing_cache(void)
static int missing_match(const void *key1, const void *key2, Size keysize)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
static HTAB * missing_cache
static void expand_tuple(HeapTuple *targetHeapTuple, MinimalTuple *targetMinimalTuple, HeapTuple sourceTuple, TupleDesc tupleDesc)
HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup)
MinimalTuple minimal_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc)
void heap_freetuple(HeapTuple htup)
HeapTupleData * HeapTuple
MinimalTupleData * MinimalTuple
HeapTupleHeaderData * HeapTupleHeader
#define HeapTupleIsValid(tuple)
#define MINIMAL_TUPLE_OFFSET
#define HeapTupleHeaderGetNatts(tup)
static void HeapTupleHeaderSetTypMod(HeapTupleHeaderData *tup, int32 typmod)
static bool HeapTupleHasNulls(const HeapTupleData *tuple)
static int BITMAPLEN(int NATTS)
static bool HeapTupleHasExternal(const HeapTupleData *tuple)
#define SizeofMinimalTupleHeader
static void HeapTupleHeaderSetTypeId(HeapTupleHeaderData *tup, Oid datum_typeid)
static CommandId HeapTupleHeaderGetRawCommandId(const HeapTupleHeaderData *tup)
static TransactionId HeapTupleHeaderGetRawXmax(const HeapTupleHeaderData *tup)
#define MaxTupleAttributeNumber
static bool HeapTupleNoNulls(const HeapTupleData *tuple)
static void HeapTupleHeaderSetDatumLength(HeapTupleHeaderData *tup, uint32 len)
static TransactionId HeapTupleHeaderGetRawXmin(const HeapTupleHeaderData *tup)
#define HeapTupleHeaderSetNatts(tup, natts)
static bool HeapTupleHasVarWidth(const HeapTupleData *tuple)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext TopMemoryContext
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static Datum PointerGetDatum(const void *X)
static Datum TransactionIdGetDatum(TransactionId X)
static Datum CommandIdGetDatum(CommandId X)
static Datum ObjectIdGetDatum(Oid X)
static char * DatumGetCString(Datum X)
static Pointer DatumGetPointer(Datum X)
bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]
#define MinTransactionIdAttributeNumber
#define MaxCommandIdAttributeNumber
#define MaxTransactionIdAttributeNumber
#define TableOidAttributeNumber
#define SelfItemPointerAttributeNumber
#define MinCommandIdAttributeNumber
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
#define att_nominal_alignby(cur_offset, attalignby)
static int first_null_attr(const bits8 *bits, int natts)
#define att_datum_alignby(cur_offset, attalignby, attlen, attdatum)
static bool att_isnull(int ATT, const bits8 *BITS)
#define att_addlength_pointer(cur_offset, attlen, attptr)
static Datum align_fetch_then_add(const char *tupptr, uint32 *off, bool attbyval, int attlen, uint8 attalignby)
#define att_pointer_alignby(cur_offset, attalignby, attlen, attptr)
static Datum fetch_att_noerr(const void *T, bool attbyval, int attlen)
#define att_addlength_datum(cur_offset, attlen, attdatum)
static void store_att_byval(void *T, Datum newdatum, int attlen)
static bool VARATT_IS_SHORT(const void *PTR)
static Size VARSIZE_ANY(const void *PTR)
static bool VARATT_CAN_MAKE_SHORT(const void *PTR)
static bool VARATT_IS_EXTERNAL(const void *PTR)
static Size VARSIZE(const void *PTR)
static char * VARDATA(const void *PTR)
static Size VARATT_CONVERTED_SHORT_SIZE(const void *PTR)
static Size VARSIZE_EXTERNAL(const void *PTR)
static bool VARATT_IS_EXTERNAL_EXPANDED(const void *PTR)
static void SET_VARSIZE_SHORT(void *PTR, Size len)
static Size VARSIZE_SHORT(const void *PTR)
Datum bit(PG_FUNCTION_ARGS)