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

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


Author: pramsey
Date: 2017-09-14 15:58:42 -0700 (Thu, 14 Sep 2017)
New Revision: 15740

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


Modified: branches/2.3/postgis/gserialized_estimate.c
===================================================================
--- branches/2.3/postgis/gserialized_estimate.c	2017-09-14 22:57:54 UTC (rev 15739)
+++ branches/2.3/postgis/gserialized_estimate.c	2017-09-14 22:58:42 UTC (rev 15740)
@@ -1561,7 +1561,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