postgresql/src/backend
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
..
access Code review for LIKE INCLUDING patch --- clean up some cosmetic and not 2009-10-13 00:53:08 +00:00
bootstrap Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust 2009-10-05 19:24:49 +00:00
catalog Support SQL-compliant triggers on columns, ie fire only if certain columns 2009-10-14 22:14:25 +00:00
commands Fix AfterTriggerSaveEvent to use a test and elog, not just Assert, to check 2009-10-27 20:14:27 +00:00
executor Make the overflow guards in ExecChooseHashTableSize be more protective. 2009-10-30 20:58:45 +00:00
foreign Somebody seems to have thought they could get away without checking for 2009-06-11 16:14:18 +00:00
lib Assorted minor refactoring in EXPLAIN. 2009-07-24 21:08:42 +00:00
libpq Rewrite pam_passwd_conv_proc to be more robust: avoid assuming that the 2009-10-16 22:08:36 +00:00
main Update copyright for 2009. 2009-01-01 17:24:05 +00:00
nodes When FOR UPDATE/SHARE is used with LIMIT, put the LockRows plan node 2009-10-28 14:55:47 +00:00
optimizer When FOR UPDATE/SHARE is used with LIMIT, put the LockRows plan node 2009-10-28 14:55:47 +00:00
parser When FOR UPDATE/SHARE is used with LIMIT, put the LockRows plan node 2009-10-28 14:55:47 +00:00
po Translations update for 8.5alpha2 2009-10-20 18:23:27 +00:00
port Reserve the shared memory region during backend startup on Windows, so 2009-07-24 20:12:42 +00:00
postmaster Fix an oversight in an 8.3-era patch: pgstat_initstats should allow stats 2009-10-02 22:49:50 +00:00
regex 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
rewrite Fix AcquireRewriteLocks to be sure that it acquires the right lock strength 2009-10-28 17:36:50 +00:00
snowball Derived files that are shipped in the distribution used to be built in the 2009-08-28 20:26:19 +00:00
storage Change the autovacuum launcher to read pg_database directly, rather than 2009-08-31 19:41:00 +00:00
tcop Re-implement EvalPlanQual processing to improve its performance and eliminate 2009-10-26 02:26:45 +00:00
tsearch Simplify a few makefile rules since install-sh can now install multiple 2009-10-26 21:33:01 +00:00
utils Un-break EXPLAIN for Append plans. I messed this up a few days ago while 2009-10-28 18:51:56 +00:00
Makefile Put back "ifeq ($(PORTNAME), solaris)", this time with some documentation 2009-09-05 21:14:04 +00:00
common.mk Expand test coverage support to entire tree 2009-08-07 20:50:22 +00:00
nls.mk Convert the core lexer and parser into fully reentrant code, by making use 2009-07-13 02:02:20 +00:00