diff options
Diffstat (limited to 'src/backend/executor/nodeIndexonlyscan.c')
-rw-r--r-- | src/backend/executor/nodeIndexonlyscan.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c index 72c04b528f5..26758e77039 100644 --- a/src/backend/executor/nodeIndexonlyscan.c +++ b/src/backend/executor/nodeIndexonlyscan.c @@ -269,23 +269,17 @@ IndexOnlyNext(IndexOnlyScanState *node) static void StoreIndexTuple(TupleTableSlot *slot, IndexTuple itup, TupleDesc itupdesc) { - int nindexatts = itupdesc->natts; - Datum *values = slot->tts_values; - bool *isnull = slot->tts_isnull; - int i; - /* - * Note: we must use the tupdesc supplied by the AM in index_getattr, not - * the slot's tupdesc, in case the latter has different datatypes (this - * happens for btree name_ops in particular). They'd better have the same - * number of columns though, as well as being datatype-compatible which is - * something we can't so easily check. + * Note: we must use the tupdesc supplied by the AM in index_deform_tuple, + * not the slot's tupdesc, in case the latter has different datatypes + * (this happens for btree name_ops in particular). They'd better have + * the same number of columns though, as well as being datatype-compatible + * which is something we can't so easily check. */ - Assert(slot->tts_tupleDescriptor->natts == nindexatts); + Assert(slot->tts_tupleDescriptor->natts == itupdesc->natts); ExecClearTuple(slot); - for (i = 0; i < nindexatts; i++) - values[i] = index_getattr(itup, i + 1, itupdesc, &isnull[i]); + index_deform_tuple(itup, itupdesc, slot->tts_values, slot->tts_isnull); ExecStoreVirtualTuple(slot); } |