aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeBitmapIndexscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeBitmapIndexscan.c')
-rw-r--r--src/backend/executor/nodeBitmapIndexscan.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/backend/executor/nodeBitmapIndexscan.c b/src/backend/executor/nodeBitmapIndexscan.c
index 0781c21676b..73b569458d3 100644
--- a/src/backend/executor/nodeBitmapIndexscan.c
+++ b/src/backend/executor/nodeBitmapIndexscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.33 2010/01/02 16:57:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.34 2010/07/12 17:01:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@
* INTERFACE ROUTINES
* MultiExecBitmapIndexScan scans a relation using index.
* ExecInitBitmapIndexScan creates and initializes state info.
- * ExecBitmapIndexReScan prepares to rescan the plan.
+ * ExecReScanBitmapIndexScan prepares to rescan the plan.
* ExecEndBitmapIndexScan releases all storage.
*/
#include "postgres.h"
@@ -60,7 +60,7 @@ MultiExecBitmapIndexScan(BitmapIndexScanState *node)
if (!node->biss_RuntimeKeysReady &&
(node->biss_NumRuntimeKeys != 0 || node->biss_NumArrayKeys != 0))
{
- ExecReScan((PlanState *) node, NULL);
+ ExecReScan((PlanState *) node);
doscan = node->biss_RuntimeKeysReady;
}
else
@@ -106,39 +106,28 @@ MultiExecBitmapIndexScan(BitmapIndexScanState *node)
}
/* ----------------------------------------------------------------
- * ExecBitmapIndexReScan(node)
+ * ExecReScanBitmapIndexScan(node)
*
- * Recalculates the value of the scan keys whose value depends on
- * information known at runtime and rescans the indexed relation.
+ * Recalculates the values of any scan keys whose value depends on
+ * information known at runtime, then rescans the indexed relation.
* ----------------------------------------------------------------
*/
void
-ExecBitmapIndexReScan(BitmapIndexScanState *node, ExprContext *exprCtxt)
+ExecReScanBitmapIndexScan(BitmapIndexScanState *node)
{
- ExprContext *econtext;
-
- econtext = node->biss_RuntimeContext; /* context for runtime keys */
+ ExprContext *econtext = node->biss_RuntimeContext;
+ /*
+ * Reset the runtime-key context so we don't leak memory as each outer
+ * tuple is scanned. Note this assumes that we will recalculate *all*
+ * runtime keys on each call.
+ */
if (econtext)
- {
- /*
- * If we are being passed an outer tuple, save it for runtime key
- * calc.
- */
- if (exprCtxt != NULL)
- econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
-
- /*
- * Reset the runtime-key context so we don't leak memory as each outer
- * tuple is scanned. Note this assumes that we will recalculate *all*
- * runtime keys on each call.
- */
ResetExprContext(econtext);
- }
/*
- * If we are doing runtime key calculations (ie, the index keys depend on
- * data from an outer scan), compute the new key values.
+ * If we are doing runtime key calculations (ie, any of the index key
+ * values weren't simple Consts), compute the new key values.
*
* Array keys are also treated as runtime keys; note that if we return
* with biss_RuntimeKeysReady still false, then there is an empty array