aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeHash.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-12-14 05:19:16 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-12-14 05:19:16 +0000
commit7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c (patch)
tree77cf346913929743b747b012d14780fb369d7041 /src/backend/executor/nodeHash.c
parentf722af618a5d6cedb0e083397f6efcec2e07b0c8 (diff)
downloadpostgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.tar.gz
postgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.zip
Initial attempt to clean up the code...
Switch sprintf() to snprintf() Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of code
Diffstat (limited to 'src/backend/executor/nodeHash.c')
-rw-r--r--src/backend/executor/nodeHash.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 63a9a83bcac..e03a33b62b2 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.24 1998/11/27 19:52:02 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.25 1998/12/14 05:18:50 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -341,7 +341,8 @@ ExecHashTableCreate(Hash *node)
if (nbatch == 0)
nbuckets = totalbuckets;
#ifdef HJDEBUG
- printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n", nbatch, totalbuckets, nbuckets);
+ printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n",
+ nbatch, totalbuckets, nbuckets);
#endif
/* ----------------
@@ -617,32 +618,14 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
+ heapTuple->t_len + HEAPTUPLESIZE);
if (newend > hashtable->bottom)
{
-#if 0
- elog(DEBUG, "hash table out of memory. expanding.");
- /* ------------------
- * XXX this is a temporary hack
- * eventually, recursive hash partitioning will be
- * implemented
- * ------------------
- */
- hashtable->readbuf = hashtable->bottom = 2 * hashtable->bottom;
- hashtable =
- (HashJoinTable) repalloc(hashtable, hashtable->bottom + BLCKSZ);
- if (hashtable == NULL)
- {
- perror("repalloc");
- elog(ERROR, "can't expand hashtable.");
- }
-#else
/* ------------------
* XXX the temporary hack above doesn't work because things
* above us don't know that we've moved the hash table!
* - Chris Dunlop, <chris@onthe.net.au>
* ------------------
*/
- elog(ERROR, "hash table out of memory. Use -B parameter to increase buffers.");
-#endif
-
+ elog(ERROR,
+ "hash table out of memory. Use -B parameter to increase buffers.");
}
/* ----------------
@@ -897,7 +880,7 @@ static int hjtmpcnt = 0;
static void
mk_hj_temp(char *tempname)
{
- sprintf(tempname, "HJ%d.%d", (int) MyProcPid, hjtmpcnt);
+ snprintf(tempname, strlen(tempname), "HJ%d.%d", (int) MyProcPid, hjtmpcnt);
hjtmpcnt = (hjtmpcnt + 1) % 1000;
}