提交 8749b6c7 编写于 作者: V Vadim B. Mikheev

execScan.c: in the end of scan projInfo->pi_slot must be

	return, not a slot returned from access method (they have
	different TupleDesc and MergeJoin node was broken).
nodeIndexscan.c: index_markpos()/index_restrpos() call index-specific
	mark/restr funcs and are in use now (instead of
	IndexScanMarkPosition()/ExecIndexRestrPos()).
上级 2c2b9838
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.6 1997/09/08 21:43:02 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.7 1998/02/26 12:13:09 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -104,11 +104,23 @@ ExecScan(Scan *node, ...@@ -104,11 +104,23 @@ ExecScan(Scan *node,
/* ---------------- /* ----------------
* if the slot returned by the accessMtd contains * if the slot returned by the accessMtd contains
* NULL, then it means there is nothing more to scan * NULL, then it means there is nothing more to scan
* so we just return the empty slot. * so we just return the empty slot...
*
* ... with invalid TupleDesc (not the same as in
* projInfo->pi_slot) and break upper MergeJoin node.
* New code below do what ExecProject() does. - vadim 02/26/98
* ---------------- * ----------------
*/ */
if (TupIsNull(slot)) if (TupIsNull(slot))
return slot; {
scanstate->cstate.cs_TupFromTlist = false;
resultSlot = scanstate->cstate.cs_ProjInfo->pi_slot;
return (TupleTableSlot *)
ExecStoreTuple (NULL,
resultSlot,
InvalidBuffer,
true);
}
/* ---------------- /* ----------------
* place the current tuple into the expr context * place the current tuple into the expr context
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.15 1998/02/26 04:31:26 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.16 1998/02/26 12:13:11 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -410,12 +410,10 @@ ExecIndexMarkPos(IndexScan *node) ...@@ -410,12 +410,10 @@ ExecIndexMarkPos(IndexScan *node)
indexScanDescs = indexstate->iss_ScanDescs; indexScanDescs = indexstate->iss_ScanDescs;
scanDesc = indexScanDescs[indexPtr]; scanDesc = indexScanDescs[indexPtr];
/* ---------------- #if 0
* XXX access methods don't return marked positions so
* ----------------
*/
IndexScanMarkPosition(scanDesc); IndexScanMarkPosition(scanDesc);
return; #endif
index_markpos (scanDesc);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
...@@ -441,7 +439,10 @@ ExecIndexRestrPos(IndexScan *node) ...@@ -441,7 +439,10 @@ ExecIndexRestrPos(IndexScan *node)
indexScanDescs = indexstate->iss_ScanDescs; indexScanDescs = indexstate->iss_ScanDescs;
scanDesc = indexScanDescs[indexPtr]; scanDesc = indexScanDescs[indexPtr];
#if 0
IndexScanRestorePosition(scanDesc); IndexScanRestorePosition(scanDesc);
#endif
index_restrpos (scanDesc);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
...@@ -713,11 +714,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent) ...@@ -713,11 +714,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
*/ */
/* Life was so easy before ... subselects */ /* Life was so easy before ... subselects */
if (((Param *) leftop)->paramkind == PARAM_EXEC) if ( ((Param *) leftop)->paramkind == PARAM_EXEC )
{ {
have_runtime_keys = true; have_runtime_keys = true;
run_keys[j] = LEFT_OP; run_keys[j] = LEFT_OP;
execParam = lappendi(execParam, ((Param *) leftop)->paramid); execParam = lappendi (execParam, ((Param*) leftop)->paramid);
} }
else else
{ {
...@@ -806,11 +807,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent) ...@@ -806,11 +807,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
*/ */
/* Life was so easy before ... subselects */ /* Life was so easy before ... subselects */
if (((Param *) rightop)->paramkind == PARAM_EXEC) if ( ((Param *) rightop)->paramkind == PARAM_EXEC )
{ {
have_runtime_keys = true; have_runtime_keys = true;
run_keys[j] = RIGHT_OP; run_keys[j] = RIGHT_OP;
execParam = lappendi(execParam, ((Param *) rightop)->paramid); execParam = lappendi (execParam, ((Param*) rightop)->paramid);
} }
else else
{ {
...@@ -991,10 +992,10 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent) ...@@ -991,10 +992,10 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
indexstate->cstate.cs_TupFromTlist = false; indexstate->cstate.cs_TupFromTlist = false;
/* /*
* if there are some PARAM_EXEC in skankeys then force index rescan on * if there are some PARAM_EXEC in skankeys then
* first scan. * force index rescan on first scan.
*/ */
((Plan *) node)->chgParam = execParam; ((Plan*) node)->chgParam = execParam;
/* ---------------- /* ----------------
* all done. * all done.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册