diff --git a/src/common/backend/catalog/index.cpp b/src/common/backend/catalog/index.cpp index 7e99bbf96..415c9a0ee 100644 --- a/src/common/backend/catalog/index.cpp +++ b/src/common/backend/catalog/index.cpp @@ -6590,10 +6590,8 @@ void ScanPartitionInsertIndex(Relation partTableRel, Relation partRel, const Lis ListCell* cell = NULL; ListCell* cell1 = NULL; EState* estate = NULL; - TupleDesc tupleDesc = NULL; TupleTableSlot* slot = NULL; - tupleDesc = partRel->rd_att; if (PointerIsValid(indexRelList)) { estate = CreateExecutorState(); @@ -6614,8 +6612,9 @@ void ScanPartitionInsertIndex(Relation partTableRel, Relation partRel, const Lis Relation indexRel = (Relation)lfirst(cell); IndexInfo* indexInfo = static_cast(lfirst(cell1)); - Datum values[tupleDesc->natts]; - bool isNull[tupleDesc->natts]; + Datum values[INDEX_MAX_KEYS]; + bool isNull[INDEX_MAX_KEYS]; + bool estateIsNotNull = false; ItemPointer t_ctid = tableam_tops_get_t_self(partTableRel, tuple);