The random selection in function linear() could deliver a value equal to max

Tom Lane <tgl@sss.pgh.pa.us>

Commit: d4b7dfacfa80cf9df9a2054f53aee59e8edc9bfc
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2005-06-14T14:21:37Z
Releases: 7.3.11
The random selection in function linear() could deliver a value equal to max
if geqo_rand() returns exactly 1.0, resulting in failure due to indexing
off the end of the pool array.  Also, since this is using inexact float math,
it seems wise to guard against roundoff error producing values slightly
outside the expected range.  Per report from bug@zedware.org.

Files

PathChange+/−
src/backend/optimizer/geqo/geqo_selection.c modified +25 −12