postgresql/src
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
..
backend Fix failure to account for memory used by tuplestore_putvalues(). 2011-06-15 14:05:22 -04:00
bin Fix oversights in pg_basebackup's -z (compression) option. 2011-06-15 13:15:05 -04:00
include The rolled-back flag on serializable xacts was pointless and redundant with 2011-06-15 13:35:28 +03:00
interfaces Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:40:35 -04:00
makefiles Rewrite installation makefile rules without for loops 2011-05-02 01:05:08 +03:00
pl Translation updates for 9.1beta2 2011-06-09 23:02:48 +03:00
port Stamp HEAD as 9.2devel. 2011-06-11 17:46:49 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:40:35 -04:00
timezone Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
tools Stamp HEAD as 9.2devel. 2011-06-11 17:46:49 -04:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:40:35 -04:00
Makefile.shlib Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:40:35 -04:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00