postgresql/src/backend
Tom Lane 10db3de66e 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.
2011-06-15 14:05:22 -04:00
..
access Make non-MVCC snapshots exempt from predicate locking. Scans with non-MVCC 2011-06-15 12:11:18 +03:00
bootstrap Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
catalog Add comment that attributes.is_nullable was removed from SQL standard 2011-06-14 22:53:02 +03:00
commands Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
executor Make non-MVCC snapshots exempt from predicate locking. Scans with non-MVCC 2011-06-15 12:11:18 +03:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Fix handling of collations in multi-row VALUES constructs. 2011-04-18 15:31:52 -04:00
optimizer Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
parser Remove unused variable 2011-06-14 23:00:43 +03:00
po Translation updates for 9.1beta2 2011-06-09 23:02:48 +03:00
port Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
postmaster Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
regex Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
replication Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
rewrite Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage The rolled-back flag on serializable xacts was pointless and redundant with 2011-06-15 13:35:28 +03:00
tcop Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
tsearch Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
utils Fix failure to account for memory used by tuplestore_putvalues(). 2011-06-15 14:05:22 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile replication/repl_gram.h needs to be cleaned too ... 2011-03-10 00:12:38 -05:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
nls.mk Translation updates for 9.1beta2 2011-06-09 23:02:48 +03:00