• Tom Lane's avatar
    Clamp adjusted ndistinct to positive integer in estimate_hash_bucketsize(). · fa09f893
    Tom Lane authored
    This avoids a possible divide-by-zero in the following calculation,
    and rounding the number to an integer seems like saner behavior anyway.
    Assuming IEEE math, the division would yield +Infinity which would get
    replaced by 1.0 at the bottom of the function, so nothing really
    interesting would ensue; but avoiding divide-by-zero seems like a
    good idea on general principles.
    
    Per report from Piotr Stefaniak.  No back-patch since this seems
    mostly cosmetic.
    fa09f893
selfuncs.c 219 KB