postgresql/src/backend
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
..
access Plug RLS related information leak in pg_stats view. 2015-07-28 13:21:37 -07:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Create a pg_shdepend entry for each role in TO clause of policies. 2015-07-28 16:01:56 -07:00
commands Create new ParseExprKind for use by policy expressions. 2015-07-29 15:41:00 -07:00
executor Avoid some zero-divide hazards in the planner. 2015-07-30 12:11:23 -04:00
foreign Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
lib Use appendStringInfoString/Char et al where appropriate. 2015-07-02 12:36:31 +03:00
libpq Remove ssl renegotiation support. 2015-07-28 22:06:31 +02:00
main Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:25 -04:00
nodes Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
optimizer Avoid some zero-divide hazards in the planner. 2015-07-30 12:11:23 -04:00
parser Create new ParseExprKind for use by policy expressions. 2015-07-29 15:41:00 -07:00
po Translation updates 2015-06-28 23:56:55 -04:00
port Make WaitLatchOrSocket's timeout detection more robust. 2015-07-18 11:47:13 -04:00
postmaster Further code review for pg_stat_ssl patch. 2015-07-27 16:29:25 -04:00
regex Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
replication Fix logical decoding bug leading to inefficient reopening of files. 2015-07-07 13:13:15 +02:00
rewrite Disallow converting a table to a view if row security is present. 2015-07-28 16:24:09 -07:00
snowball Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
storage Remove outdated comment in LWLockDequeueSelf's header. 2015-07-29 10:14:32 +02:00
tcop Fix DDL command collection for TRANSFORM 2015-06-26 18:17:54 -03:00
tsearch pgindent run for 9.5 2015-05-23 21:35:49 -04:00
utils Avoid some zero-divide hazards in the planner. 2015-07-30 12:11:23 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile AIX: Link the postgres executable with -Wl,-brtllib. 2015-07-15 21:00:30 -04:00
nls.mk Translation updates 2015-02-01 23:23:40 -05:00