Fix buffile.c error handling.
authorThomas Munro <[email protected]>
Tue, 16 Jun 2020 01:50:56 +0000 (13:50 +1200)
committerThomas Munro <[email protected]>
Tue, 16 Jun 2020 05:01:22 +0000 (17:01 +1200)
commit89020a92fb62fe09cd40d651ecbd4cd9912fd9d8
tree8a3cada83a0b5d5c0e2fdf5a753b8dcbe57ede58
parent39c698cff8a004c0027ffeb8c97b754d08a9a544
Fix buffile.c error handling.

Convert buffile.c error handling to use ereport.  This fixes cases where
I/O errors were indistinguishable from EOF or not reported.  Also remove
"%m" from error messages where errno would be bogus.  While we're
modifying those strings, add block numbers and short read byte counts
where appropriate.

Back-patch to all supported releases.

Reported-by: Amit Khandekar <[email protected]>
Reviewed-by: Melanie Plageman <[email protected]>
Reviewed-by: Alvaro Herrera <[email protected]>
Reviewed-by: Robert Haas <[email protected]>
Reviewed-by: Ibrar Ahmed <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/CA%2BhUKGJE04G%3D8TLK0DLypT_27D9dR8F1RQgNp0jK6qR0tZGWOw%40mail.gmail.com
src/backend/access/gist/gistbuildbuffers.c
src/backend/executor/nodeHashjoin.c
src/backend/storage/file/buffile.c
src/backend/utils/sort/logtape.c
src/backend/utils/sort/tuplestore.c