1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Modify hash_create() to elog(ERROR) if an error occurs, rather than

returning a NULL pointer (some callers remembered to check the return
value, but some did not -- it is safer to just bail out).

Also, cleanup pgstat.c to use elog(ERROR) rather than elog(LOG) followed
by exit().
This commit is contained in:
Neil Conway
2004-10-25 00:46:43 +00:00
parent 346aff04be
commit 8ec05b28b7
9 changed files with 49 additions and 175 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.11 2004/08/29 05:06:42 momjian Exp $
* $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.12 2004/10/25 00:46:40 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@ -322,10 +322,6 @@ BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
hashtable->hashtab = hash_create("TupleHashTable", (long) nbuckets,
&hash_ctl,
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
if (hashtable->hashtab == NULL)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
return hashtable;
}