Commit 78099231 authored by Tom Lane's avatar Tom Lane

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

output first outer tuple before advancing...
parent 47e22976
......@@ -8,7 +8,7 @@
*
*
* 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)
{
/*
* Need to emit left-join tuples for remaining
* outer tuples. We set MatchedOuter = true to
* force the ENDINNER state to advance outer.
* Need to emit left-join tuples for all outer tuples,
* including the one we just fetched. We set
* MatchedOuter = false to force the ENDINNER state
* to emit this tuple before advancing outer.
*/
mergestate->mj_JoinState = EXEC_MJ_ENDINNER;
mergestate->mj_MatchedOuter = true;
mergestate->mj_MatchedOuter = false;
break;
}
/* Otherwise we're done. */
......
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