diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-05-06 00:30:47 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-05-06 00:30:47 +0000 |
commit | 9f82f9e45902d05e221798e82c22ac95d7a5c3e1 (patch) | |
tree | e40e427f1dbca3f21c15528077f854d6edf6db8b /src/include/executor/hashjoin.h | |
parent | 5d5cf912bc28e8aea13d2e6689bb9e67f166a40e (diff) |
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/include/executor/hashjoin.h')
-rw-r--r-- | src/include/executor/hashjoin.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h index 66e88a09157..ec6c234f28b 100644 --- a/src/include/executor/hashjoin.h +++ b/src/include/executor/hashjoin.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: hashjoin.h,v 1.8 1999/02/13 23:21:24 momjian Exp $ + * $Id: hashjoin.h,v 1.9 1999/05/06 00:30:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,18 +17,23 @@ /* ----------------- * have to use relative address as pointers in the hashtable - * because the hashtable may reallocate in difference processes + * because the hashtable may reallocate in different processes + * + * XXX: this relative-address stuff is useless on all supported platforms + * and is a ever-dangerous source of bugs. Really ought to rip it out. * ----------------- */ typedef int RelativeAddr; /* ------------------ - * the relative addresses are always relative to the head of the - * hashtable, the following macro converts them to absolute address. + * The relative addresses are always relative to the head of the + * hashtable, the following macros convert them to/from absolute address. + * NULL is represented as -1 (CAUTION: RELADDR() doesn't handle that!). + * CAUTION: ABSADDR evaluates its arg twice!! * ------------------ */ -#define ABSADDR(X) ((X) < 0 ? NULL: (char*)hashtable + X) -#define RELADDR(X) (RelativeAddr)((char*)(X) - (char*)hashtable) +#define ABSADDR(X) ((X) < 0 ? (char*) NULL : (char*)hashtable + (X)) +#define RELADDR(X) ((RelativeAddr)((char*)(X) - (char*)hashtable)) typedef char **charPP; typedef int *intP; @@ -79,6 +84,4 @@ typedef struct HashBucketData typedef HashBucketData *HashBucket; -#define HASH_PERMISSION 0700 - #endif /* HASHJOIN_H */ |