summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorHeikki Linnakangas2019-06-06 06:46:52 +0000
committerHeikki Linnakangas2019-06-06 06:46:52 +0000
commitcd96389d713787b025c84869ba417c6f2f008a86 (patch)
treedec68fd47e5d6bf7e94185607d12bf2ce9afc3dd /src/include/nodes
parent6c0c28383749c0ade89ac70ba6dbce9af140c0a9 (diff)
Fix confusion on different kinds of slots in IndexOnlyScans.
We used the same slot to store a tuple from the index, and to store a tuple from the table. That's not OK. It worked with the heap, because heapam_getnextslot() stores a HeapTuple to the slot, and doesn't care how large the tts_values/nulls arrays are. But when I played with a toy table AM implementation that used a virtual tuple, it caused memory overruns. In the passing, tidy up comments on the ioss_PscanLen fields.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 112a9a53683..99b9fa414f1 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -1359,7 +1359,7 @@ typedef struct
* SortSupport for reordering ORDER BY exprs
* OrderByTypByVals is the datatype of order by expression pass-by-value?
* OrderByTypLens typlens of the datatypes of order by expressions
- * pscan_len size of parallel index scan descriptor
+ * PscanLen size of parallel index scan descriptor
* ----------------
*/
typedef struct IndexScanState
@@ -1403,8 +1403,9 @@ typedef struct IndexScanState
* RuntimeContext expr context for evaling runtime Skeys
* RelationDesc index relation descriptor
* ScanDesc index scan descriptor
+ * TableSlot slot for holding tuples fetched from the table
* VMBuffer buffer in use for visibility map testing, if any
- * ioss_PscanLen Size of parallel index-only scan descriptor
+ * PscanLen size of parallel index-only scan descriptor
* ----------------
*/
typedef struct IndexOnlyScanState
@@ -1421,6 +1422,7 @@ typedef struct IndexOnlyScanState
ExprContext *ioss_RuntimeContext;
Relation ioss_RelationDesc;
struct IndexScanDescData *ioss_ScanDesc;
+ TupleTableSlot *ioss_TableSlot;
Buffer ioss_VMBuffer;
Size ioss_PscanLen;
} IndexOnlyScanState;