aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeIndexscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-05-31 20:45:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-05-31 20:45:26 +0000
commitcc3e9deee615c57673896cd486bd74773d841b55 (patch)
treefa72bfbc5fb07b3d3862e3c9ce756154d9662961 /src/backend/executor/nodeIndexscan.c
parent10f719af331b0248f532fb1eeee642f93ed981a9 (diff)
downloadpostgresql-cc3e9deee615c57673896cd486bd74773d841b55.tar.gz
postgresql-cc3e9deee615c57673896cd486bd74773d841b55.zip
The shortcut exit that I recently added to ExecInitIndexScan() for
EXPLAIN-only operation was a little too short; it skipped initializing the node's result tuple type, which may be needed depending on what's above the indexscan node. Call ExecAssignResultTypeFromTL before exiting. (For good luck I moved up the ExecAssignScanProjectionInfo call as well, so that everything except indexscan-specific initialization will still be done.) Per example from Grant Finnemore.
Diffstat (limited to 'src/backend/executor/nodeIndexscan.c')
-rw-r--r--src/backend/executor/nodeIndexscan.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 8c22e3ade0e..a1fb29ad2c1 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.122 2007/05/25 17:54:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.123 2007/05/31 20:45:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -523,6 +523,12 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
ExecAssignScanType(&indexstate->ss, RelationGetDescr(currentRelation));
/*
+ * Initialize result tuple type and projection info.
+ */
+ ExecAssignResultTypeFromTL(&indexstate->ss.ps);
+ ExecAssignScanProjectionInfo(&indexstate->ss);
+
+ /*
* If we are just doing EXPLAIN (ie, aren't going to run the plan),
* stop here. This allows an index-advisor plugin to EXPLAIN a plan
* containing references to nonexistent indexes.
@@ -590,12 +596,6 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
indexstate->iss_ScanKeys);
/*
- * Initialize result tuple type and projection info.
- */
- ExecAssignResultTypeFromTL(&indexstate->ss.ps);
- ExecAssignScanProjectionInfo(&indexstate->ss);
-
- /*
* all done.
*/
return indexstate;