summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-09-08 02:11:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-09-08 02:11:33 +0000
commit16f1cfcb87584336641629180b4e8dc8cf9f304f (patch)
treedff680c61be11d094e84cdcb742783ae5d9d4449 /src/backend/executor
parent4fc84653989b69182fcc0cbc518b24b6147bc4e6 (diff)
Back-patch fix for bogus plans involving non-mark/restorable plan
as inner plan of a mergejoin.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execAmi.c16
-rw-r--r--src/backend/executor/nodeMaterial.c37
2 files changed, 27 insertions, 26 deletions
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 579465bf0b8..376eeef8b5d 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execAmi.c,v 1.46 2000/04/12 17:15:07 momjian Exp $
+ * $Id: execAmi.c,v 1.46.2.1 2000/09/08 02:11:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -424,7 +424,7 @@ ExecMarkPos(Plan *node)
{
switch (nodeTag(node))
{
- case T_SeqScan:
+ case T_SeqScan:
ExecSeqMarkPos((SeqScan *) node);
break;
@@ -432,6 +432,10 @@ ExecMarkPos(Plan *node)
ExecIndexMarkPos((IndexScan *) node);
break;
+ case T_Material:
+ ExecMaterialMarkPos((Material *) node);
+ break;
+
case T_Sort:
ExecSortMarkPos((Sort *) node);
break;
@@ -458,7 +462,7 @@ ExecRestrPos(Plan *node)
{
switch (nodeTag(node))
{
- case T_SeqScan:
+ case T_SeqScan:
ExecSeqRestrPos((SeqScan *) node);
return;
@@ -466,12 +470,16 @@ ExecRestrPos(Plan *node)
ExecIndexRestrPos((IndexScan *) node);
return;
+ case T_Material:
+ ExecMaterialRestrPos((Material *) node);
+ break;
+
case T_Sort:
ExecSortRestrPos((Sort *) node);
return;
default:
- elog(DEBUG, "ExecRestrPos: node type %u not supported", nodeTag(node));
+ elog(ERROR, "ExecRestrPos: node type %u not supported", nodeTag(node));
return;
}
}
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c
index 4348f89ccc9..4f67892682b 100644
--- a/src/backend/executor/nodeMaterial.c
+++ b/src/backend/executor/nodeMaterial.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.30 2000/03/02 04:06:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.30.2.1 2000/09/08 02:11:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -352,35 +352,30 @@ ExecMaterialReScan(Material *node, ExprContext *exprCtxt, Plan *parent)
}
-#ifdef NOT_USED /* not used */
/* ----------------------------------------------------------------
* ExecMaterialMarkPos
* ----------------------------------------------------------------
*/
-List /* nothing of interest */
-ExecMaterialMarkPos(Material node)
+void
+ExecMaterialMarkPos(Material *node)
{
- MaterialState matstate;
+ MaterialState *matstate;
HeapScanDesc scan;
/* ----------------
- * if we haven't materialized yet, just return NIL.
+ * if we haven't materialized yet, just return.
* ----------------
*/
- matstate = get_matstate(node);
- if (get_mat_Flag(matstate) == false)
- return NIL;
+ matstate = node->matstate;
+ if (matstate->mat_Flag == false)
+ return;
/* ----------------
- * XXX access methods don't return positions yet so
- * for now we return NIL. It's possible that
- * they will never return positions for all I know -cim 10/16/89
+ * mark the scan position
* ----------------
*/
- scan = get_css_currentScanDesc((CommonScanState) matstate);
+ scan = matstate->csstate.css_currentScanDesc;
heap_markpos(scan);
-
- return NIL;
}
/* ----------------------------------------------------------------
@@ -388,25 +383,23 @@ ExecMaterialMarkPos(Material node)
* ----------------------------------------------------------------
*/
void
-ExecMaterialRestrPos(Material node)
+ExecMaterialRestrPos(Material *node)
{
- MaterialState matstate;
+ MaterialState *matstate;
HeapScanDesc scan;
/* ----------------
* if we haven't materialized yet, just return.
* ----------------
*/
- matstate = get_matstate(node);
- if (get_mat_Flag(matstate) == false)
+ matstate = node->matstate;
+ if (matstate->mat_Flag == false)
return;
/* ----------------
* restore the scan to the previously marked position
* ----------------
*/
- scan = get_css_currentScanDesc((CommonScanState) matstate);
+ scan = matstate->csstate.css_currentScanDesc;
heap_restrpos(scan);
}
-
-#endif