diff options
Diffstat (limited to 'src/backend/executor/nodeHashjoin.c')
-rw-r--r-- | src/backend/executor/nodeHashjoin.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 9dbbd7f8c38..b215e3f59a5 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -1260,28 +1260,18 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate, * we can read them both in one BufFileRead() call without any type * cheating. */ - nread = BufFileRead(file, header, sizeof(header)); + nread = BufFileReadMaybeEOF(file, header, sizeof(header), true); if (nread == 0) /* end of file */ { ExecClearTuple(tupleSlot); return NULL; } - if (nread != sizeof(header)) - ereport(ERROR, - (errcode_for_file_access(), - errmsg("could not read from hash-join temporary file: read only %zu of %zu bytes", - nread, sizeof(header)))); *hashvalue = header[0]; tuple = (MinimalTuple) palloc(header[1]); tuple->t_len = header[1]; - nread = BufFileRead(file, - ((char *) tuple + sizeof(uint32)), - header[1] - sizeof(uint32)); - if (nread != header[1] - sizeof(uint32)) - ereport(ERROR, - (errcode_for_file_access(), - errmsg("could not read from hash-join temporary file: read only %zu of %zu bytes", - nread, header[1] - sizeof(uint32)))); + BufFileReadExact(file, + (char *) tuple + sizeof(uint32), + header[1] - sizeof(uint32)); ExecForceStoreMinimalTuple(tuple, tupleSlot, true); return tupleSlot; } |