From 1763fab84ff01fdff78897d275a2f6dfa39602ca Mon Sep 17 00:00:00 2001 From: openGaussDev Date: Fri, 4 Mar 2022 14:52:43 +0800 Subject: [PATCH] fix index bug Offering: openGaussDev More detail: fix index bug Match-id-0f03a389aa14be42e77b3ae7dc9aa5b0d94cf863 --- src/gausskernel/runtime/executor/nodeIndexonlyscan.cpp | 2 +- src/gausskernel/runtime/opfusion/opfusion_indexonlyscan.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/runtime/executor/nodeIndexonlyscan.cpp b/src/gausskernel/runtime/executor/nodeIndexonlyscan.cpp index 79fefa14b..fb7bf002a 100644 --- a/src/gausskernel/runtime/executor/nodeIndexonlyscan.cpp +++ b/src/gausskernel/runtime/executor/nodeIndexonlyscan.cpp @@ -138,7 +138,7 @@ static TupleTableSlot* IndexOnlyNext(IndexOnlyScanState* node) slot = node->ss.ss_ScanTupleSlot; isUHeap = RelationIsUstoreFormat(node->ss.ss_currentRelation); tmpslot = MakeSingleTupleTableSlot(RelationGetDescr(scandesc->heapRelation), - false, scandesc->indexRelation->rd_tam_type); + false, scandesc->heapRelation->rd_tam_type); /* * OK, now that we have what we need, fetch the next tuple. diff --git a/src/gausskernel/runtime/opfusion/opfusion_indexonlyscan.cpp b/src/gausskernel/runtime/opfusion/opfusion_indexonlyscan.cpp index 53cf1a61c..796d35366 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_indexonlyscan.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_indexonlyscan.cpp @@ -221,7 +221,8 @@ TupleTableSlot *IndexOnlyScanFusion::getTupleSlotInternal() bool isUStore = RelationIsUstoreFormat(m_rel); bool bucket_changed = false; TupleTableSlot* tmpreslot = NULL; - tmpreslot = MakeSingleTupleTableSlot(RelationGetDescr(m_scandesc->heapRelation), false, rel->rd_tam_type); + tmpreslot = MakeSingleTupleTableSlot(RelationGetDescr(m_scandesc->heapRelation), + false, m_scandesc->heapRelation->rd_tam_type); while ((tid = scan_handler_idx_getnext_tid(m_scandesc, *m_direction, &bucket_changed)) != NULL) { HeapTuple tuple = NULL;