]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix breakage in hashjoin from recent backpatch of left-join bug fix.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Oct 2004 21:56:22 +0000 (21:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Oct 2004 21:56:22 +0000 (21:56 +0000)
(That's what I get for not testing the back branches *before* committing.)

src/backend/executor/nodeHashjoin.c

index 7d3924b4972c9394619925650ad8e3d16fcf36ad..ee8146d03ce25e2e4ddd063a47c21598a7d5f72e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.38.2.1 2004/09/17 18:29:54 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.38.2.2 2004/10/13 21:56:22 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "utils/memutils.h"
 
 
-static TupleTableSlot *ExecHashJoinOuterGetTuple(Plan *node, Plan *parent,
+static TupleTableSlot *ExecHashJoinOuterGetTuple(Plan *node, HashJoin *parent,
                                                  HashJoinState *hjstate);
 static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
                                                  BufFile *file,
                                                  TupleTableSlot *tupleSlot);
 static int     ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable);
-static int     ExecHashJoinNewBatch(HashJoinState *hjstate);
+static int     ExecHashJoinNewBatch(HashJoinState *hjstate, HashJoin *node);
 
 
 /* ----------------------------------------------------------------
@@ -155,7 +155,7 @@ ExecHashJoin(HashJoin *node)
                if (hjstate->hj_NeedNewOuter)
                {
                        outerTupleSlot = ExecHashJoinOuterGetTuple(outerNode,
-                                                                                                          (Plan *) node,
+                                                                                                          node,
                                                                                                           hjstate);
                        if (TupIsNull(outerTupleSlot))
                        {
@@ -475,7 +475,7 @@ ExecEndHashJoin(HashJoin *node)
  */
 
 static TupleTableSlot *
-ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
+ExecHashJoinOuterGetTuple(Plan *node, HashJoin *parent, HashJoinState *hjstate)
 {
        HashJoinTable hashtable = hjstate->hj_HashTable;
        int                     curbatch = hashtable->curbatch;
@@ -483,7 +483,7 @@ ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
 
        if (curbatch == 0)
        {                                                       /* if it is the first pass */
-               slot = ExecProcNode(node, parent);
+               slot = ExecProcNode(node, (Plan *) parent);
                if (!TupIsNull(slot))
                        return slot;
 
@@ -491,7 +491,7 @@ ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
                 * We have just reached the end of the first pass. Try to switch
                 * to a saved batch.
                 */
-               curbatch = ExecHashJoinNewBatch(hjstate);
+               curbatch = ExecHashJoinNewBatch(hjstate, parent);
        }
 
        /*
@@ -505,7 +505,7 @@ ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
                                                                                 hjstate->hj_OuterTupleSlot);
                if (!TupIsNull(slot))
                        return slot;
-               curbatch = ExecHashJoinNewBatch(hjstate);
+               curbatch = ExecHashJoinNewBatch(hjstate, parent);
        }
 
        /* Out of batches... */
@@ -551,7 +551,7 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
  * ----------------------------------------------------------------
  */
 static int
-ExecHashJoinNewBatch(HashJoinState *hjstate)
+ExecHashJoinNewBatch(HashJoinState *hjstate, HashJoin *node)
 {
        HashJoinTable hashtable = hjstate->hj_HashTable;
        int                     nbatch = hashtable->nbatch;
@@ -582,7 +582,7 @@ ExecHashJoinNewBatch(HashJoinState *hjstate)
        while (newbatch <= nbatch &&
                   (outerBatchSize[newbatch - 1] == 0L ||
                        (innerBatchSize[newbatch - 1] == 0L &&
-                        hjstate->js.jointype != JOIN_LEFT)))
+                        node->join.jointype != JOIN_LEFT)))
        {
                BufFileClose(hashtable->innerBatchFile[newbatch - 1]);
                hashtable->innerBatchFile[newbatch - 1] = NULL;