• Robert Haas's avatar
    Avoid valgrind complaint about write() of uninitalized bytes. · 9fafa413
    Robert Haas authored
    LogicalTapeFreeze() may write out its first block when it is dirty but
    not full, and then immediately read the first block back in from its
    BufFile as a BLCKSZ-width block.  This can only occur in rare cases
    where very few tuples were written out, which is currently only
    possible with parallel external tuplesorts.  To avoid valgrind
    complaints, tell it to treat the tail of logtape.c's buffer as
    defined.
    
    Commit 9da0cc35 exposed this problem
    but did not create it.  LogicalTapeFreeze() has always tended to write
    out some amount of garbage bytes, but previously never wrote less than
    one block of data in total, so the problem was masked.
    
    Per buildfarm members lousyjack and skink.
    
    Peter Geoghegan, based on a suggestion from Tom Lane and me.  Some
    comment revisions by me.
    9fafa413
logtape.c 33.1 KB