diff --git a/src/gausskernel/storage/access/common/heaptuple.cpp b/src/gausskernel/storage/access/common/heaptuple.cpp index 33bc78fc2236da7fe8ad3cee80521acb3fa50c5a..dbe468d825bfe68d80ce147c16627d63bd4e1c08 100644 --- a/src/gausskernel/storage/access/common/heaptuple.cpp +++ b/src/gausskernel/storage/access/common/heaptuple.cpp @@ -1760,9 +1760,12 @@ void heap_slot_getsomeattrs(TupleTableSlot *slot, int attnum) } #endif - int attno = GetAttrNumber(slot, attnum); + int attno = attnum; + if (slot->tts_tuple) { + attno = GetAttrNumber(slot, attnum); - slot_deform_tuple(slot, attno); + slot_deform_tuple(slot, attno); + } /* If tuple doesn't have all the atts indicated by tupleDesc, read the rest as null */ if (unlikely(attno < attnum)) {