8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.38.2.1 2004/09/17 18:29:54 tgl Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.38.2.2 2004/10/13 21:56:22 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
23
23
#include "utils/memutils.h"
24
24
25
25
26
- static TupleTableSlot * ExecHashJoinOuterGetTuple (Plan * node , Plan * parent ,
26
+ static TupleTableSlot * ExecHashJoinOuterGetTuple (Plan * node , HashJoin * parent ,
27
27
HashJoinState * hjstate );
28
28
static TupleTableSlot * ExecHashJoinGetSavedTuple (HashJoinState * hjstate ,
29
29
BufFile * file ,
30
30
TupleTableSlot * tupleSlot );
31
31
static int ExecHashJoinGetBatch (int bucketno , HashJoinTable hashtable );
32
- static int ExecHashJoinNewBatch (HashJoinState * hjstate );
32
+ static int ExecHashJoinNewBatch (HashJoinState * hjstate , HashJoin * node );
33
33
34
34
35
35
/* ----------------------------------------------------------------
@@ -155,7 +155,7 @@ ExecHashJoin(HashJoin *node)
155
155
if (hjstate -> hj_NeedNewOuter )
156
156
{
157
157
outerTupleSlot = ExecHashJoinOuterGetTuple (outerNode ,
158
- ( Plan * ) node ,
158
+ node ,
159
159
hjstate );
160
160
if (TupIsNull (outerTupleSlot ))
161
161
{
@@ -475,23 +475,23 @@ ExecEndHashJoin(HashJoin *node)
475
475
*/
476
476
477
477
static TupleTableSlot *
478
- ExecHashJoinOuterGetTuple (Plan * node , Plan * parent , HashJoinState * hjstate )
478
+ ExecHashJoinOuterGetTuple (Plan * node , HashJoin * parent , HashJoinState * hjstate )
479
479
{
480
480
HashJoinTable hashtable = hjstate -> hj_HashTable ;
481
481
int curbatch = hashtable -> curbatch ;
482
482
TupleTableSlot * slot ;
483
483
484
484
if (curbatch == 0 )
485
485
{ /* if it is the first pass */
486
- slot = ExecProcNode (node , parent );
486
+ slot = ExecProcNode (node , ( Plan * ) parent );
487
487
if (!TupIsNull (slot ))
488
488
return slot ;
489
489
490
490
/*
491
491
* We have just reached the end of the first pass. Try to switch
492
492
* to a saved batch.
493
493
*/
494
- curbatch = ExecHashJoinNewBatch (hjstate );
494
+ curbatch = ExecHashJoinNewBatch (hjstate , parent );
495
495
}
496
496
497
497
/*
@@ -505,7 +505,7 @@ ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
505
505
hjstate -> hj_OuterTupleSlot );
506
506
if (!TupIsNull (slot ))
<
E282
tr class="diff-line-row">507
507
return slot ;
508
- curbatch = ExecHashJoinNewBatch (hjstate );
508
+ curbatch = ExecHashJoinNewBatch (hjstate , parent );
509
509
}
510
510
511
511
/* Out of batches... */
@@ -551,7 +551,7 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
551
551
* ----------------------------------------------------------------
552
552
*/
553
553
static int
554
- ExecHashJoinNewBatch (HashJoinState * hjstate )
554
+ ExecHashJoinNewBatch (HashJoinState * hjstate , HashJoin * node )
555
555
{
556
556
HashJoinTable hashtable = hjstate -> hj_HashTable ;
557
557
int nbatch = hashtable -> nbatch ;
@@ -582,7 +582,7 @@ ExecHashJoinNewBatch(HashJoinState *hjstate)
582
582
while (newbatch <= nbatch &&
583
583
(outerBatchSize [newbatch - 1 ] == 0L ||
584
584
(innerBatchSize [newbatch - 1 ] == 0L &&
585
- hjstate -> js .jointype != JOIN_LEFT )))
585
+ node -> join .jointype != JOIN_LEFT )))
586
586
{
587
587
BufFileClose (hashtable -> innerBatchFile [newbatch - 1 ]);
588
588
hashtable -> innerBatchFile [newbatch - 1 ] = NULL ;
0 commit comments