postgresql/src/backend/utils
Tom Lane 0c2c0f82c2 Guard against input_rows == 0 in estimate_num_groups().
This case doesn't normally happen, because the planner usually clamps
all row estimates to at least one row; but I found that it can arise
when dealing with relations excluded by constraints.  Without a defense,
estimate_num_groups() can return zero, which leads to divisions by zero
inside the planner as well as assertion failures in the executor.

An alternative fix would be to change set_dummy_rel_pathlist() to make
the size estimate for a dummy relation 1 row instead of 0, but that seemed
pretty ugly; and probably someday we'll want to drop the convention that
the minimum rowcount estimate is 1 row.

Back-patch to 8.4, as the problem can be demonstrated that far back.
2013-05-10 17:15:43 -04:00
..
adt Guard against input_rows == 0 in estimate_num_groups(). 2013-05-10 17:15:43 -04:00
cache Fix longstanding race condition in plancache.c. 2013-04-20 16:59:31 -04:00
error Tweak previous patch to ensure edata->filename always gets initialized. 2011-11-30 00:37:14 -05:00
fmgr Ignore SECURITY DEFINER and SET attributes for a PL's call handler. 2012-05-30 23:28:10 -04:00
hash Add defenses against integer overflow in dynahash numbuckets calculations. 2012-12-11 22:09:20 -05:00
init Fix insecure parsing of server command-line switches. 2013-04-01 14:01:04 -04:00
mb Back-patch addition of pg_wchar-to-multibyte conversion functionality. 2012-07-10 16:53:27 -04:00
misc Reset vacuum_defer_cleanup_age to PGC_SIGHUP. 2013-02-04 16:42:12 +00:00
mmgr Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:18:39 -05:00
resowner pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
sort Fix failure to account for memory used by tuplestore_putvalues(). 2011-06-15 14:05:39 -04:00
time Fix race condition in enum value comparisons. 2012-07-01 17:12:59 -04:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Per-column collation support 2011-02-08 23:04:18 +02:00
Gen_dummy_probes.sed Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Gen_fmgrtab.pl Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
generate-errcodes.pl Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00