diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-15 14:05:22 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-15 14:05:39 -0400 |
commit | 3cfecae3a34853c631eeb75671c6b82638e8e0aa (patch) | |
tree | 0c56414fd5ea2f5de7bdb2489868b9e9596dee34 /src/backend/utils/adt/ruleutils.c | |
parent | dc014e0446f5bfb52129fc6781a98b236d8166c6 (diff) | |
download | postgresql-3cfecae3a34853c631eeb75671c6b82638e8e0aa.tar.gz postgresql-3cfecae3a34853c631eeb75671c6b82638e8e0aa.zip |
Fix failure to account for memory used by tuplestore_putvalues().
This oversight could result in a tuplestore using much more than the
intended amount of memory. It would only happen in a code path that loaded
a tuplestore via tuplestore_putvalues(), and many of those won't emit huge
amounts of data; but cases such as holdable cursors and plpgsql's RETURN
NEXT command could have the problem. The fix ensures that the tuplestore
will switch to write-to-disk mode when it overruns work_mem.
The potential overrun was finite, because we would still count the space
used by the tuple pointer array, so the tuplestore code would eventually
flip into write-to-disk mode anyway. When storing wide tuples we would
go far past the expected work_mem usage before that happened; but this
may account for the lack of prior reports.
Back-patch to 8.4, where tuplestore_putvalues was introduced.
Per bug #6061 from Yann Delorme.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
0 files changed, 0 insertions, 0 deletions