Fix thinko for case of outer join where inner table is empty: should

output first outer tuple before advancing...
This commit is contained in:
Tom Lane 2000-12-13 23:45:46 +00:00
parent 47e229760a
commit 780992316f

View file

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.39 2000/11/16 22:30:22 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.40 2000/12/13 23:45:46 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -537,12 +537,13 @@ ExecMergeJoin(MergeJoin *node)
if (doFillOuter) if (doFillOuter)
{ {
/* /*
* Need to emit left-join tuples for remaining * Need to emit left-join tuples for all outer tuples,
* outer tuples. We set MatchedOuter = true to * including the one we just fetched. We set
* force the ENDINNER state to advance outer. * MatchedOuter = false to force the ENDINNER state
* to emit this tuple before advancing outer.
*/ */
mergestate->mj_JoinState = EXEC_MJ_ENDINNER; mergestate->mj_JoinState = EXEC_MJ_ENDINNER;
mergestate->mj_MatchedOuter = true; mergestate->mj_MatchedOuter = false;
break; break;
} }
/* Otherwise we're done. */ /* Otherwise we're done. */