aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-27 18:06:53 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-27 18:07:16 -0400
commitfa09f8935156533584b4e215bdf70ec1ff968dad (patch)
treeac391eb6237aac234ff9aeaf43f0b199c41bac3d /src/backend/parser/parse_clause.c
parent408f0438531eec17ac62f91fc23f72bcfc48dd36 (diff)
downloadpostgresql-fa09f8935156533584b4e215bdf70ec1ff968dad.tar.gz
postgresql-fa09f8935156533584b4e215bdf70ec1ff968dad.zip
Clamp adjusted ndistinct to positive integer in estimate_hash_bucketsize().
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.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
0 files changed, 0 insertions, 0 deletions