1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Fix some nasty coredump bugs in hashjoin. This code was just

about certain to fail anytime it decided the relation to be hashed was
too big to fit in memory --- the code for 'batching' a series of hashjoins
had multiple errors.  I've fixed the easier problems.  A remaining big
problem is that you can get 'hashtable out of memory' if the code's
guesstimate about how much overflow space it will need turns out wrong.
That will require much more extensive revisions to fix, so I'm committing
these fixes now before I start on that problem.
This commit is contained in:
Tom Lane
1999-05-06 00:30:47 +00:00
parent 5d5cf912bc
commit 9f82f9e459
3 changed files with 142 additions and 130 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.17 1999/02/13 23:15:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.18 1999/05/06 00:30:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -650,8 +650,8 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
heapTuple = (HeapTuple) (*position);
heapTuple->t_data = (HeapTupleHeader)
((char *) heapTuple + HEAPTUPLESIZE);
(*position) = (char *) LONGALIGN(*position +
heapTuple->t_len + HEAPTUPLESIZE);
(*position) = (char *) MAXALIGN(*position +
heapTuple->t_len + HEAPTUPLESIZE);
return ExecStoreTuple(heapTuple, tupleSlot, InvalidBuffer, false);
}
@ -843,7 +843,7 @@ ExecHashJoinSaveTuple(HeapTuple heapTuple,
}
memmove(position, heapTuple, HEAPTUPLESIZE);
memmove(position + HEAPTUPLESIZE, heapTuple->t_data, heapTuple->t_len);
position = (char *) LONGALIGN(position + heapTuple->t_len + HEAPTUPLESIZE);
position = (char *) MAXALIGN(position + heapTuple->t_len + HEAPTUPLESIZE);
*pageend = position - buffer;
return position;