Skip to content

Commit 72cbfa4

Browse files
committed
Fix aboriginal bug in BufFileDumpBuffer that would cause it to write the
wrong data when dumping a bufferload that crosses a component-file boundary. This probably has not been seen in the wild because (a) component files are normally 1GB apiece and (b) non-block-aligned buffer usage is relatively rare. But it's fairly easy to reproduce a problem if one reduces RELSEG_SIZE in a test build. Kudos to Kurt Harriman for spotting the bug.
1 parent 2d91f67 commit 72cbfa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/file/buffile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/file/buffile.c,v 1.14 2002/09/05 00:43:07 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/file/buffile.c,v 1.14.2.1 2007/06/01 23:43:39 tgl Exp $
1111
*
1212
* NOTES:
1313
*
@@ -287,7 +287,7 @@ BufFileDumpBuffer(BufFile *file)
287287
return; /* seek failed, give up */
288288
file->offsets[file->curFile] = file->curOffset;
289289
}
290-
bytestowrite = FileWrite(thisfile, file->buffer, bytestowrite);
290+
bytestowrite = FileWrite(thisfile, file->buffer + wpos, bytestowrite);
291291
if (bytestowrite <= 0)
292292
return; /* failed to write */
293293
file->offsets[file->curFile] += bytestowrite;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy