postgresql/src
Tom Lane e91a1643ac Avoid some zero-divide hazards in the planner.
Although I think on all modern machines floating division by zero
results in Infinity not SIGFPE, we still don't want infinities
running around in the planner's costing estimates; too much risk
of that leading to insane behavior.

grouping_planner() failed to consider the possibility that final_rel
might be known dummy and hence have zero rowcount.  (I wonder if it
would be better to set a rows estimate of 1 for dummy relations?
But at least in the back branches, changing this convention seems
like a bad idea, so I'll leave that for another day.)

Make certain that get_variable_numdistinct() produces a nonzero result.
The case that can be shown to be broken is with stadistinct < 0.0 and
small ntuples; we did not prevent the result from rounding to zero.
For good luck I applied clamp_row_est() to all the nonconstant return
values.

In ExecChooseHashTableSize(), Assert that we compute positive nbuckets
and nbatch.  I know of no reason to think this isn't the case, but it
seems like a good safety check.

Per reports from Piotr Stefaniak.  Back-patch to all active branches.
2015-07-30 12:11:23 -04:00
..
backend Avoid some zero-divide hazards in the planner. 2015-07-30 12:11:23 -04:00
bin Fix calculation of latency of pgbench backslash commands. 2015-07-30 14:51:08 +03:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Create new ParseExprKind for use by policy expressions. 2015-07-29 15:41:00 -07:00
interfaces Improve handling of out-of-memory in libpq. 2015-07-07 18:47:25 +03:00
makefiles Fix parallel make risk with new check temp-install setup 2015-04-29 20:34:22 -04:00
pl Fix (some of) pltcl memory usage 2015-07-20 14:18:08 +02:00
port Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Create new ParseExprKind for use by policy expressions. 2015-07-29 15:41:00 -07:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:29 -04:00
tools MSVC: Revert most 9.5 changes to pre-9.5 vcregress.pl tests. 2015-07-29 22:52:00 -04:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04: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 Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Make tap tests store postmaster logs and handle vpaths correctly 2015-07-28 16:04:05 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:30 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00