[postgis-tickets] r15742 - #3731, backend crash on zero size stats histogram

Paul Ramsey pramsey at cleverelephant.ca
Thu Sep 14 15:59:14 PDT 2017


Author: pramsey
Date: 2017-09-14 15:59:14 -0700 (Thu, 14 Sep 2017)
New Revision: 15742

Modified:
   branches/2.1/postgis/gserialized_estimate.c
Log:
#3731, backend crash on zero size stats histogram



Modified: branches/2.1/postgis/gserialized_estimate.c
===================================================================
--- branches/2.1/postgis/gserialized_estimate.c	2017-09-14 22:58:57 UTC (rev 15741)
+++ branches/2.1/postgis/gserialized_estimate.c	2017-09-14 22:59:14 UTC (rev 15742)
@@ -1473,7 +1473,7 @@
 		histo_cells_new = 1;
 		for ( d = 0; d < ndims; d++ )
 		{
-			histo_size[d] = (int)pow((double)histo_cells_target, 1/(double)ndims);
+			histo_size[d] = 1 + (int)pow((double)histo_cells_target, 1/(double)ndims);
 			POSTGIS_DEBUGF(3, "   histo_size[d]: %d", histo_size[d]);
 			histo_cells_new *= histo_size[d];
 		}



More information about the postgis-tickets mailing list