aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/spgist/spginsert.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-12-08 10:15:24 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-12-08 10:15:57 +0200
commitf7d54f4f7ddf72bf4db1783890b058e758b4b894 (patch)
tree25f1f05f81e302c80e2e8e38fb1e474bb2c44bc9 /src/backend/access/spgist/spginsert.c
parentcd5d3af44e2a4f73c692d4653941c0516f967cb7 (diff)
downloadpostgresql-f7d54f4f7ddf72bf4db1783890b058e758b4b894.tar.gz
postgresql-f7d54f4f7ddf72bf4db1783890b058e758b4b894.zip
Fix accounting of memory needed for merge heap.
We allegedly allocated all remaining memory for the read buffers of the sort tapes, but we allocated the merge heap only after that. That means that the allocation of the merge heap was guaranteed to go over the memory limit. Fix by allocating the merge heap first. This makes little difference in practice, because the merge heap is tiny, but let's tidy. While we're at it, add a safeguard for the case that we are already over the limit when allocating the read buffers. That shouldn't happen, but better safe than sorry. The memory accounting error was reported off-list by Peter Geoghegan.
Diffstat (limited to 'src/backend/access/spgist/spginsert.c')
0 files changed, 0 insertions, 0 deletions