]> granicus.if.org Git - postgresql/commit
Fix integer overflow bug in GiST buffering build calculations.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 29 May 2012 19:22:43 +0000 (22:22 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 29 May 2012 19:27:42 +0000 (22:27 +0300)
commit4bc6fb57f774ea18187fd8565aad9994160bfc17
tree7559f20bd7f1e97efe8b6d9a329a2ccf81b79cc0
parent2755abf386e6572bad15cb6a032e504ad32308cc
Fix integer overflow bug in GiST buffering build calculations.

The result of (maintenance_work_mem * 1024) / BLCKSZ doesn't fit in a signed
32-bit integer, if maintenance_work_mem >= 2GB. Use double instead. And
while we're at it, write the calculations in an easier to understand form,
with the intermediary steps written out and commented.
src/backend/access/gist/gistbuild.c