aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistvacuum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-10-19 15:24:03 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-10-19 15:24:03 -0400
commit4e32f8cd14fa6c66400e8af188bea78b22cf5f56 (patch)
tree063f1dcac1e110b2f8680d0c0bdef770f492c073 /src/backend/access/gist/gistvacuum.c
parent0d6895051a2e53026ad0daae0ebc3cb901acc521 (diff)
downloadpostgresql-4e32f8cd14fa6c66400e8af188bea78b22cf5f56.tar.gz
postgresql-4e32f8cd14fa6c66400e8af188bea78b22cf5f56.zip
Fix hash_search to avoid corruption of the hash table on out-of-memory.
An out-of-memory error during expand_table() on a palloc-based hash table would leave a partially-initialized entry in the table. This would not be harmful for transient hash tables, since they'd get thrown away anyway at transaction abort. But for long-lived hash tables, such as the relcache hash, this would effectively corrupt the table, leading to crash or other misbehavior later. To fix, rearrange the order of operations so that table enlargement is attempted before we insert a new entry, rather than after adding it to the hash table. Problem discovered by Hitoshi Harada, though this is a bit different from his proposed patch.
Diffstat (limited to 'src/backend/access/gist/gistvacuum.c')
0 files changed, 0 insertions, 0 deletions