Skip to content

Commit f5f366e

Browse files
committed
Allow internal sorts to be stored in memory rather than in files.
1 parent 3bea7b1 commit f5f366e

File tree

11 files changed

+630
-513
lines changed

11 files changed

+630
-513
lines changed

src/backend/executor/nodeMergejoin.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.5 1996/11/10 02:59:54 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.6 1997/08/06 03:41:29 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -374,6 +374,18 @@ ExecMergeTupleDump(ExprContext *econtext, MergeJoinState *mergestate)
374374
printf("******** \n");
375375
}
376376

377+
static void
378+
CleanUpSort(Plan *plan) {
379+
380+
if (plan == NULL)
381+
return;
382+
383+
if (plan->type == T_Sort) {
384+
Sort *sort = (Sort *)plan;
385+
psort_end(sort);
386+
}
387+
}
388+
377389
/* ----------------------------------------------------------------
378390
* ExecMergeJoin
379391
*
@@ -676,6 +688,8 @@ ExecMergeJoin(MergeJoin *node)
676688
*/
677689
if (TupIsNull(outerTupleSlot)) {
678690
MJ_printf("ExecMergeJoin: **** outer tuple is nil ****\n");
691+
CleanUpSort(node->join.lefttree->lefttree);
692+
CleanUpSort(node->join.righttree->lefttree);
679693
return NULL;
680694
}
681695

0 commit comments

Comments
 (0)