]> granicus.if.org Git - postgresql/commit
Fix SortTocFromFile() to cope with lines that are too long for its buffer.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Apr 2011 15:40:39 +0000 (11:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Apr 2011 15:40:39 +0000 (11:40 -0400)
commit9a9c7c2eb10b8df67c5652a6678a172b83a262eb
tree94305159af841881b95b5a9a851ebd78c6d6b69a
parentcfce572aceb0a8c809f5f52b7c8002b9917bcb19
Fix SortTocFromFile() to cope with lines that are too long for its buffer.

The original coding supposed that a dump TOC file could never contain lines
longer than 1K.  The folly of that was exposed by a recent report from
Per-Olov Esgard.  We only really need to see the first dozen or two bytes
of each line, since we're just trying to read off the numeric ID at the
start of the line; so there's no need for a particularly huge buffer.
What there is a need for is logic to not process continuation bufferloads.

Back-patch to all supported branches, since it's always been like this.
src/bin/pg_dump/pg_backup_archiver.c