1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Vadim's OR fix.

This commit is contained in:
Bruce Momjian
1998-11-24 02:05:14 +00:00
parent 0db829c494
commit 461c0ffc8f
7 changed files with 28 additions and 12 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.25.2.1 1998/11/12 03:46:14 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.25.2.2 1998/11/24 02:05:02 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -217,9 +217,14 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
{ {
case T_IndexScan: case T_IndexScan:
appendStringInfo(str, " using "); appendStringInfo(str, " using ");
l = ((IndexScan *) plan)->indxid; i = 0;
relation = RelationIdCacheGetRelation((int) lfirst(l)); foreach (l, ((IndexScan *) plan)->indxid)
appendStringInfo(str, (RelationGetRelationName(relation))->data); {
relation = RelationIdCacheGetRelation((int) lfirst(l));
if (++i > 1)
appendStringInfo(str, ", ");
appendStringInfo(str, (RelationGetRelationName(relation))->data);
}
case T_SeqScan: case T_SeqScan:
if (((Scan *) plan)->scanrelid > 0) if (((Scan *) plan)->scanrelid > 0)
{ {

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.27 1998/09/01 04:28:32 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.27.2.1 1998/11/24 02:05:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -154,7 +154,7 @@ IndexNext(IndexScan *node)
prev_index++) prev_index++)
{ {
scanstate->cstate.cs_ExprContext->ecxt_scantuple = slot; scanstate->cstate.cs_ExprContext->ecxt_scantuple = slot;
if (ExecQual(nth(prev_index, node->indxqual), if (ExecQual(nth(prev_index, node->indxqualorig),
scanstate->cstate.cs_ExprContext)) scanstate->cstate.cs_ExprContext))
{ {
prev_matches = true; prev_matches = true;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.49 1998/10/22 13:52:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.49.2.1 1998/11/24 02:05:05 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -247,6 +247,7 @@ _copyIndexScan(IndexScan *from)
*/ */
newnode->indxid = listCopy(from->indxid); newnode->indxid = listCopy(from->indxid);
Node_Copy(from, newnode, indxqual); Node_Copy(from, newnode, indxqual);
Node_Copy(from, newnode, indxqualorig);
Node_Copy(from, newnode, indxstate); Node_Copy(from, newnode, indxstate);
return newnode; return newnode;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.47 1998/10/22 13:52:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.47.2.1 1998/11/24 02:05:07 momjian Exp $
* *
* NOTES * NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which * Every (plan) node in POSTGRES has an associated "out" routine which
@ -517,6 +517,9 @@ _outIndexScan(StringInfo str, IndexScan *node)
appendStringInfo(str, " :indxqual "); appendStringInfo(str, " :indxqual ");
_outNode(str, node->indxqual); _outNode(str, node->indxqual);
appendStringInfo(str, " :indxqualorig ");
_outNode(str, node->indxqualorig);
} }
/* /*

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.38 1998/10/22 13:52:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.38.2.1 1998/11/24 02:05:08 momjian Exp $
* *
* NOTES * NOTES
* Most of the read functions for plan nodes are tested. (In fact, they * Most of the read functions for plan nodes are tested. (In fact, they
@ -546,6 +546,9 @@ _readIndexScan()
token = lsptok(NULL, &length); /* eat :indxqual */ token = lsptok(NULL, &length); /* eat :indxqual */
local_node->indxqual = nodeRead(true); /* now read it */ local_node->indxqual = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :indxqualorig */
local_node->indxqualorig = nodeRead(true); /* now read it */
return local_node; return local_node;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.32 1998/09/01 04:29:47 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.32.2.1 1998/11/24 02:05:09 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -63,7 +63,7 @@ static Node *fix_indxqual_references(Node *clause, Path *index_path);
static Temp *make_temp(List *tlist, List *keys, Oid *operators, static Temp *make_temp(List *tlist, List *keys, Oid *operators,
Plan *plan_node, int temptype); Plan *plan_node, int temptype);
static IndexScan *make_indexscan(List *qptlist, List *qpqual, Index scanrelid, static IndexScan *make_indexscan(List *qptlist, List *qpqual, Index scanrelid,
List *indxid, List *indxqual, Cost cost); List *indxid, List *indxqual, List *indxqualorig, Cost cost);
static NestLoop *make_nestloop(List *qptlist, List *qpqual, Plan *lefttree, static NestLoop *make_nestloop(List *qptlist, List *qpqual, Plan *lefttree,
Plan *righttree); Plan *righttree);
static HashJoin *make_hashjoin(List *tlist, List *qpqual, static HashJoin *make_hashjoin(List *tlist, List *qpqual,
@ -405,6 +405,7 @@ create_indexscan_node(IndexPath *best_path,
lfirsti(best_path->path.parent->relids), lfirsti(best_path->path.parent->relids),
best_path->indexid, best_path->indexid,
fixed_indxqual, fixed_indxqual,
indxqual,
best_path->path.path_cost); best_path->path.path_cost);
return scan_node; return scan_node;
@ -937,6 +938,7 @@ make_indexscan(List *qptlist,
Index scanrelid, Index scanrelid,
List *indxid, List *indxid,
List *indxqual, List *indxqual,
List *indxqualorig,
Cost cost) Cost cost)
{ {
IndexScan *node = makeNode(IndexScan); IndexScan *node = makeNode(IndexScan);
@ -951,6 +953,7 @@ make_indexscan(List *qptlist,
node->scan.scanrelid = scanrelid; node->scan.scanrelid = scanrelid;
node->indxid = indxid; node->indxid = indxid;
node->indxqual = indxqual; node->indxqual = indxqual;
node->indxqualorig = indxqualorig;
node->scan.scanstate = (CommonScanState *) NULL; node->scan.scanstate = (CommonScanState *) NULL;
return node; return node;

View File

@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: plannodes.h,v 1.18 1998/09/01 04:36:46 momjian Exp $ * $Id: plannodes.h,v 1.18.2.1 1998/11/24 02:05:14 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -174,6 +174,7 @@ typedef struct IndexScan
Scan scan; Scan scan;
List *indxid; List *indxid;
List *indxqual; List *indxqual;
List *indxqualorig;
IndexScanState *indxstate; IndexScanState *indxstate;
} IndexScan; } IndexScan;