]> granicus.if.org Git - postgresql/blobdiff - src/backend/executor/nodeTidscan.c
Make some small planner API cleanups.
[postgresql] / src / backend / executor / nodeTidscan.c
index 593185f726ba65a28cbbe9650f5a53eba4464eff..8daf09c785a5e30fce6d69ee113bdb953f253f4a 100644 (file)
@@ -3,7 +3,7 @@
  * nodeTidscan.c
  *       Routines to support direct tid scans of relations
  *
- * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  */
 #include "postgres.h"
 
+#include "access/heapam.h"
 #include "access/sysattr.h"
 #include "catalog/pg_type.h"
 #include "executor/execdebug.h"
 #include "executor/nodeTidscan.h"
 #include "miscadmin.h"
-#include "optimizer/clauses.h"
+#include "nodes/nodeFuncs.h"
 #include "storage/bufmgr.h"
 #include "utils/array.h"
 #include "utils/rel.h"
@@ -487,7 +488,8 @@ ExecEndTidScan(TidScanState *node)
        /*
         * clear out tuple table slots
         */
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
+       if (node->ss.ps.ps_ResultTupleSlot)
+               ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
        ExecClearTuple(node->ss.ss_ScanTupleSlot);
 }
 
@@ -531,7 +533,7 @@ ExecInitTidScan(TidScan *node, EState *estate, int eflags)
        tidstate->tss_TidPtr = -1;
 
        /*
-        * open the base relation and acquire appropriate lock on it.
+        * open the scan relation
         */
        currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
 
@@ -542,12 +544,13 @@ ExecInitTidScan(TidScan *node, EState *estate, int eflags)
         * get the scan type from the relation descriptor.
         */
        ExecInitScanTupleSlot(estate, &tidstate->ss,
-                                                 RelationGetDescr(currentRelation));
+                                                 RelationGetDescr(currentRelation),
+                                                 &TTSOpsBufferHeapTuple);
 
        /*
-        * Initialize result slot, type and projection.
+        * Initialize result type and projection.
         */
-       ExecInitResultTupleSlotTL(estate, &tidstate->ss.ps);
+       ExecInitResultTypeTL(&tidstate->ss.ps);
        ExecAssignScanProjectionInfo(&tidstate->ss);
 
        /*