From 08bbfb0d634a6c1c191eb83d50edd117b070d545 Mon Sep 17 00:00:00 2001 From: totaj Date: Thu, 19 Oct 2023 15:58:23 +0800 Subject: [PATCH] Fix only full group bug. --- src/gausskernel/storage/access/common/heaptuple.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/storage/access/common/heaptuple.cpp b/src/gausskernel/storage/access/common/heaptuple.cpp index dbe468d82..f30fddc45 100644 --- a/src/gausskernel/storage/access/common/heaptuple.cpp +++ b/src/gausskernel/storage/access/common/heaptuple.cpp @@ -1577,8 +1577,13 @@ Datum heap_slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull, bool nee */ /* internal error */ if (tuple == NULL) { - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot extract attribute from empty tuple slot"))); + /* tuple is null, now only happen in B mode, with sql_mode_full_group trun off. set all isnull to true */ + int rc = memset_s(slot->tts_isnull, slot->tts_tupleDescriptor->natts * sizeof(bool), + true, slot->tts_tupleDescriptor->natts * sizeof(bool)); + securec_check(rc, "\0", "\0"); + slot->tts_nvalid = slot->tts_tupleDescriptor->natts; + *isnull = true; + return (Datum) 0; } /*