diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-01 23:43:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-01 23:43:17 +0000 |
commit | 1e172f9692eb8ab0d7fa221910ec8839f5325229 (patch) | |
tree | a814a00f3964ec8180688d51a48b211f1162828d /src | |
parent | 3e2c198e06a5c67f8adbcaf53c7d65ed504c72dd (diff) | |
download | postgresql-1e172f9692eb8ab0d7fa221910ec8839f5325229.tar.gz postgresql-1e172f9692eb8ab0d7fa221910ec8839f5325229.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/file/buffile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index 76096284345..af162c710c4 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/file/buffile.c,v 1.24 2006/07/14 05:28:28 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/file/buffile.c,v 1.24.2.1 2007/06/01 23:43:17 tgl Exp $ * * NOTES: * @@ -289,7 +289,7 @@ BufFileDumpBuffer(BufFile *file) return; /* seek failed, give up */ file->offsets[file->curFile] = file->curOffset; } - bytestowrite = FileWrite(thisfile, file->buffer, bytestowrite); + bytestowrite = FileWrite(thisfile, file->buffer + wpos, bytestowrite); if (bytestowrite <= 0) return; /* failed to write */ file->offsets[file->curFile] += bytestowrite; |