From dfb3766e94cf49e26d9f6ffb46633e0bee197883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=A3=AE?= Date: Wed, 8 May 2024 01:51:03 +0000 Subject: [PATCH] Revert "fix ExecEvalFieldStore incorrectly using astore methods to deform ustore tuples." This reverts commit 3846f82a786cb7e9882b2fc625e11730d44403ba. --- src/gausskernel/runtime/executor/execQual.cpp | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/src/gausskernel/runtime/executor/execQual.cpp b/src/gausskernel/runtime/executor/execQual.cpp index 5dfab97dc..1ffb16fd5 100644 --- a/src/gausskernel/runtime/executor/execQual.cpp +++ b/src/gausskernel/runtime/executor/execQual.cpp @@ -5446,36 +5446,21 @@ 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. */ - if (GetTableAmType(tupDesc->td_tam_ops) == TAM_USTORE) { - UHeapDiskTuple tuphdr; - UHeapTupleData tmptup; - /* 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; + 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.xc_node_id = 0; + tmptup.t_xc_node_id = 0; #endif - HeapTupleSetZeroBase(&tmptup); - tmptup.disk_tuple = tuphdr; - 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); - } + 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));