]> granicus.if.org Git - postgresql/commit
Modify hash_search() API to prevent future occurrences of the error
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 May 2005 04:23:07 +0000 (04:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 May 2005 04:23:07 +0000 (04:23 +0000)
commite92a88272eb2b164e7e8c625ad3f7ad267e0224f
tree3ca62f2a6cdd52f78911a50b628f16e77e70be78
parentecd70d75267ccf845e8f3976048d944e4ee35cf7
Modify hash_search() API to prevent future occurrences of the error
spotted by Qingqing Zhou.  The HASH_ENTER action now automatically
fails with elog(ERROR) on out-of-memory --- which incidentally lets
us eliminate duplicate error checks in quite a bunch of places.  If
you really need the old return-NULL-on-out-of-memory behavior, you
can ask for HASH_ENTER_NULL.  But there is now an Assert in that path
checking that you aren't hoping to get that behavior in a palloc-based
hash table.
Along the way, remove the old HASH_FIND_SAVE/HASH_REMOVE_SAVED actions,
which were not being used anywhere anymore, and were surely too ugly
and unsafe to want to see revived again.
23 files changed:
contrib/dblink/dblink.c
contrib/tablefunc/tablefunc.c
src/backend/access/transam/xlogutils.c
src/backend/commands/prepare.c
src/backend/executor/execGrouping.c
src/backend/nodes/tidbitmap.c
src/backend/postmaster/pgstat.c
src/backend/storage/buffer/buf_table.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/freespace/freespace.c
src/backend/storage/ipc/shmem.c
src/backend/storage/lmgr/lock.c
src/backend/storage/smgr/md.c
src/backend/storage/smgr/smgr.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/typcache.c
src/backend/utils/fmgr/fmgr.c
src/backend/utils/hash/dynahash.c
src/backend/utils/mmgr/portalmem.c
src/include/utils/hsearch.h
src/pl/plpgsql/src/pl_comp.c
src/timezone/pgtz.c