Commit d320101b authored by Tom Lane's avatar Tom Lane

Get rid of the last remaining uses of var_is_rel(), to wit some debugging

checks in ExecIndexBuildScanKeys() that were inadequate anyway: it's better
to verify the correct varno on an expected index key, not just reject OUTER
and INNER.

This makes the entire current contents of nodeFuncs.c dead code.  I'll be
replacing it with some other stuff later, as per recent proposal.
parent e36716a6
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.27 2008/04/13 20:51:20 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.28 2008/08/25 20:20:29 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -275,6 +275,7 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags) ...@@ -275,6 +275,7 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
*/ */
ExecIndexBuildScanKeys((PlanState *) indexstate, ExecIndexBuildScanKeys((PlanState *) indexstate,
indexstate->biss_RelationDesc, indexstate->biss_RelationDesc,
node->scan.scanrelid,
node->indexqual, node->indexqual,
&indexstate->biss_ScanKeys, &indexstate->biss_ScanKeys,
&indexstate->biss_NumScanKeys, &indexstate->biss_NumScanKeys,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.129 2008/06/19 00:46:04 alvherre Exp $ * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.130 2008/08/25 20:20:30 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "access/relscan.h" #include "access/relscan.h"
#include "executor/execdebug.h" #include "executor/execdebug.h"
#include "executor/nodeIndexscan.h" #include "executor/nodeIndexscan.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/clauses.h" #include "optimizer/clauses.h"
#include "utils/array.h" #include "utils/array.h"
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
...@@ -576,6 +575,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags) ...@@ -576,6 +575,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
*/ */
ExecIndexBuildScanKeys((PlanState *) indexstate, ExecIndexBuildScanKeys((PlanState *) indexstate,
indexstate->iss_RelationDesc, indexstate->iss_RelationDesc,
node->scan.scanrelid,
node->indexqual, node->indexqual,
&indexstate->iss_ScanKeys, &indexstate->iss_ScanKeys,
&indexstate->iss_NumScanKeys, &indexstate->iss_NumScanKeys,
...@@ -653,6 +653,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags) ...@@ -653,6 +653,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
* *
* planstate: executor state node we are working for * planstate: executor state node we are working for
* index: the index we are building scan keys for * index: the index we are building scan keys for
* scanrelid: varno of the index's relation within current query
* quals: indexquals expressions * quals: indexquals expressions
* *
* Output params are: * Output params are:
...@@ -668,8 +669,8 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags) ...@@ -668,8 +669,8 @@ ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
* ScalarArrayOpExpr quals are not supported. * ScalarArrayOpExpr quals are not supported.
*/ */
void void
ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, ExecIndexBuildScanKeys(PlanState *planstate, Relation index, Index scanrelid,
ScanKey *scanKeys, int *numScanKeys, List *quals, ScanKey *scanKeys, int *numScanKeys,
IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys,
IndexArrayKeyInfo **arrayKeys, int *numArrayKeys) IndexArrayKeyInfo **arrayKeys, int *numArrayKeys)
{ {
...@@ -753,7 +754,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, ...@@ -753,7 +754,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals,
Assert(leftop != NULL); Assert(leftop != NULL);
if (!(IsA(leftop, Var) && if (!(IsA(leftop, Var) &&
var_is_rel((Var *) leftop))) ((Var *) leftop)->varno == scanrelid))
elog(ERROR, "indexqual doesn't have key on left side"); elog(ERROR, "indexqual doesn't have key on left side");
varattno = ((Var *) leftop)->varattno; varattno = ((Var *) leftop)->varattno;
...@@ -837,7 +838,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, ...@@ -837,7 +838,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals,
Assert(leftop != NULL); Assert(leftop != NULL);
if (!(IsA(leftop, Var) && if (!(IsA(leftop, Var) &&
var_is_rel((Var *) leftop))) ((Var *) leftop)->varno == scanrelid))
elog(ERROR, "indexqual doesn't have key on left side"); elog(ERROR, "indexqual doesn't have key on left side");
varattno = ((Var *) leftop)->varattno; varattno = ((Var *) leftop)->varattno;
...@@ -942,7 +943,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, ...@@ -942,7 +943,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals,
Assert(leftop != NULL); Assert(leftop != NULL);
if (!(IsA(leftop, Var) && if (!(IsA(leftop, Var) &&
var_is_rel((Var *) leftop))) ((Var *) leftop)->varno == scanrelid))
elog(ERROR, "indexqual doesn't have key on left side"); elog(ERROR, "indexqual doesn't have key on left side");
varattno = ((Var *) leftop)->varattno; varattno = ((Var *) leftop)->varattno;
...@@ -1003,7 +1004,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, ...@@ -1003,7 +1004,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals,
Assert(leftop != NULL); Assert(leftop != NULL);
if (!(IsA(leftop, Var) && if (!(IsA(leftop, Var) &&
var_is_rel((Var *) leftop))) ((Var *) leftop)->varno == scanrelid))
elog(ERROR, "NullTest indexqual has wrong key"); elog(ERROR, "NullTest indexqual has wrong key");
varattno = ((Var *) leftop)->varattno; varattno = ((Var *) leftop)->varattno;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/executor/nodeIndexscan.h,v 1.32 2008/04/13 20:51:21 tgl Exp $ * $PostgreSQL: pgsql/src/include/executor/nodeIndexscan.h,v 1.33 2008/08/25 20:20:30 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -26,6 +26,7 @@ extern void ExecIndexReScan(IndexScanState *node, ExprContext *exprCtxt); ...@@ -26,6 +26,7 @@ extern void ExecIndexReScan(IndexScanState *node, ExprContext *exprCtxt);
/* routines exported to share code with nodeBitmapIndexscan.c */ /* routines exported to share code with nodeBitmapIndexscan.c */
extern void ExecIndexBuildScanKeys(PlanState *planstate, Relation index, extern void ExecIndexBuildScanKeys(PlanState *planstate, Relation index,
Index scanrelid,
List *quals, ScanKey *scanKeys, int *numScanKeys, List *quals, ScanKey *scanKeys, int *numScanKeys,
IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys,
IndexArrayKeyInfo **arrayKeys, int *numArrayKeys); IndexArrayKeyInfo **arrayKeys, int *numArrayKeys);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment