aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeHashjoin.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-05-06 00:30:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-05-06 00:30:47 +0000
commit9f82f9e45902d05e221798e82c22ac95d7a5c3e1 (patch)
treee40e427f1dbca3f21c15528077f854d6edf6db8b /src/backend/executor/nodeHashjoin.c
parent5d5cf912bc28e8aea13d2e6689bb9e67f166a40e (diff)
downloadpostgresql-9f82f9e45902d05e221798e82c22ac95d7a5c3e1.tar.gz
postgresql-9f82f9e45902d05e221798e82c22ac95d7a5c3e1.zip
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.
Diffstat (limited to 'src/backend/executor/nodeHashjoin.c')
-rw-r--r--src/backend/executor/nodeHashjoin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index a2710148fbf..b4ffdd5c73a 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -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;