]> granicus.if.org Git - postgresql/commit
Use 64 bit type for BufFileSize().
authorThomas Munro <tmunro@postgresql.org>
Wed, 14 Nov 2018 23:34:04 +0000 (12:34 +1300)
committerThomas Munro <tmunro@postgresql.org>
Thu, 15 Nov 2018 00:13:57 +0000 (13:13 +1300)
commitaa5518304213a762b62ebe3dbb057d220d8976eb
tree122ccb8d03151063d2563076c4f3298674fd2043
parenteaf746a5b85a6a794e659f0954cf0015e42213f4
Use 64 bit type for BufFileSize().

BufFileSize() can't use off_t, because it's only 32 bits wide on
some systems.  BufFile objects can have many 1GB segments so the
total size can exceed 2^31.  The only known client of the function
is parallel CREATE INDEX, which was reported to fail when building
large indexes on Windows.

Though this is technically an ABI break on platforms with a 32 bit
off_t and we might normally avoid back-patching it, the function is
brand new and thus unlikely to have been discovered by extension
authors yet, and it's fairly thoroughly broken on those platforms
anyway, so just fix it.

Defect in 9da0cc35.  Bug #15460.  Back-patch to 11, where this
function landed.

Author: Thomas Munro
Reported-by: Paul van der Linden, Pavel Oskin
Reviewed-by: Peter Geoghegan
Discussion: https://postgr.es/m/15460-b6db80de822fa0ad%40postgresql.org
Discussion: https://postgr.es/m/CAHDGBJP_GsESbTt4P3FZA8kMUKuYxjg57XHF7NRBoKnR%3DCAR-g%40mail.gmail.com
src/backend/storage/file/buffile.c
src/backend/utils/sort/logtape.c
src/include/storage/buffile.h