fix ExecEvalFieldStore incorrectly using astore methods to deform ustore tuples.

This commit is contained in:
zhaosen
2024-05-08 09:56:34 +08:00
committed by yaoxin
parent dfb3766e94
commit ad3eafc5dc
2 changed files with 31 additions and 12 deletions

View File

@ -5446,21 +5446,40 @@ static Datum ExecEvalFieldStore(FieldStoreState* fstate, ExprContext* econtext,
* heap_deform_tuple needs a HeapTuple not a bare HeapTupleHeader. We
* set all the fields in the struct just in case.
*/
HeapTupleHeader tuphdr;
HeapTupleData tmptup;
if (GetTableAmType(tupDesc->td_tam_ops) == TAM_USTORE) {
UHeapDiskTuple tuphdr;
UHeapTupleData tmptup;
tuphdr = DatumGetHeapTupleHeader(tupDatum);
tmptup.t_len = HeapTupleHeaderGetDatumLength(tuphdr);
ItemPointerSetInvalid(&(tmptup.t_self));
tmptup.t_tableOid = InvalidOid;
tmptup.t_bucketId = InvalidBktId;
/* UHeapDiskTuple and HeapTupleHeader have the same layout */
tuphdr = (UHeapDiskTuple) DatumGetHeapTupleHeader(tupDatum);
tmptup.disk_tuple_size = HeapTupleHeaderGetDatumLength(tuphdr);
ItemPointerSetInvalid(&(tmptup.ctid));
tmptup.table_oid = InvalidOid;
tmptup.t_bucketId = InvalidBktId;
#ifdef PGXC
tmptup.t_xc_node_id = 0;
tmptup.xc_node_id = 0;
#endif
HeapTupleSetZeroBase(&tmptup);
tmptup.t_data = tuphdr;
HeapTupleSetZeroBase(&tmptup);
tmptup.disk_tuple = tuphdr;
tableam_tops_deform_tuple(&tmptup, tupDesc, values, isnull);
tableam_tops_deform_tuple(&tmptup, tupDesc, values, isnull);
} else {
HeapTupleHeader tuphdr;
HeapTupleData tmptup;
tuphdr = DatumGetHeapTupleHeader(tupDatum);
tmptup.t_len = HeapTupleHeaderGetDatumLength(tuphdr);
ItemPointerSetInvalid(&(tmptup.t_self));
tmptup.t_tableOid = InvalidOid;
tmptup.t_bucketId = InvalidBktId;
#ifdef PGXC
tmptup.t_xc_node_id = 0;
#endif
HeapTupleSetZeroBase(&tmptup);
tmptup.t_data = tuphdr;
tableam_tops_deform_tuple(&tmptup, tupDesc, values, isnull);
}
} else {
/* Convert null input tuple into an all-nulls row */
rc = memset_s(isnull, tupDesc->natts * sizeof(bool), true, tupDesc->natts * sizeof(bool));

View File

@ -5517,7 +5517,7 @@ static void check_global_variables()
}
}
#define BASE_PGXC_LIKE_MACRO_NUM 1395
#define BASE_PGXC_LIKE_MACRO_NUM 1396
static void check_pgxc_like_macros()
{
#ifdef BUILD_BY_CMAKE