postgresql/src
Tom Lane dbd68df9b6 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:51 -04:00
..
backend Guard against input_rows == 0 in estimate_num_groups(). 2013-05-10 17:15:51 -04:00
bin Translation updates 2013-03-31 23:38:50 -04:00
include Fix crash on compiling a regular expression with more than 32k colors. 2013-04-04 19:32:13 +03:00
interfaces Stamp 9.0.13. 2013-04-01 14:25:34 -04:00
makefiles Make pgxs build executables with the right suffix. 2013-01-19 14:54:29 -05:00
pl Translation updates 2013-03-31 23:38:50 -04:00
port Stamp 9.0.13. 2013-04-01 14:25:34 -04:00
template Don't try to force use of -no-cpp-precomp on OS X. It's been five years 2010-08-02 04:51:25 +00:00
test Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. 2013-02-08 18:03:33 -05:00
timezone Update time zone data files to tzdata release 2013b. 2013-03-28 15:26:04 -04:00
tools Properly zero-pad the day-of-year part of the win32 build number 2013-01-31 15:08:43 +01:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:02 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +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 Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Add mode where contrib installcheck runs each module in a separately named database. 2012-12-11 11:48:00 -05:00
Makefile.shlib Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
nls-global.mk Avoid error from mkdir if no languages are to be installed 2010-05-13 14:35:28 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00