postgresql/src
Tom Lane 8442317beb Make the overflow guards in ExecChooseHashTableSize be more protective.
The original coding ensured nbuckets and nbatch didn't exceed INT_MAX,
which while not insane on its own terms did nothing to protect subsequent
code like "palloc(nbatch * sizeof(BufFile *))".  Since enormous join size
estimates might well be planner error rather than reality, it seems best
to constrain the initial sizes to be not more than work_mem/sizeof(pointer),
thus ensuring the allocated arrays don't exceed work_mem.  We will allow
nbatch to get bigger than that during subsequent ExecHashIncreaseNumBatches
calls, but we should still guard against integer overflow in those palloc
requests.  Per bug #5145 from Bernt Marius Johnsen.

Although the given test case only seems to fail back to 8.2, previous
releases have variants of this issue, so patch all supported branches.
2009-10-30 20:58:45 +00:00
..
backend Make the overflow guards in ExecChooseHashTableSize be more protective. 2009-10-30 20:58:45 +00:00
bin Fix \df to re-allow regexp special characters in the function name pattern. 2009-10-28 18:09:44 +00:00
include Fix AcquireRewriteLocks to be sure that it acquires the right lock strength 2009-10-28 17:36:50 +00:00
interfaces Simplify a few makefile rules since install-sh can now install multiple 2009-10-26 21:33:01 +00:00
makefiles Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
pl Translations update for 8.5alpha2 2009-10-20 18:23:27 +00:00
port Don't error out if recycling or removing an old WAL segment fails at the end 2009-09-13 18:32:08 +00:00
template Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running 2009-02-11 20:02:40 +00:00
test Check errors in for loop 2009-10-26 21:11:22 +00:00
timezone Fix a couple of issues in recent patch to print updates to postgresql.conf 2009-10-03 18:04:57 +00:00
tools Update translation updating procedure. This pertains to some changes I 2009-10-20 18:22:19 +00:00
tutorial 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00: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 Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
Makefile.global.in Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
Makefile.shlib Derived files that are shipped in the distribution used to be built in the 2009-08-28 20:26:19 +00:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
nls-global.mk Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00