Advance input pointer when LZ4 compressing data
Tomas Vondra <tomas.vondra@postgresql.org>
Advance input pointer when LZ4 compressing data LZ4File_write() did not advance the input pointer on subsequent invocations of LZ4F_compressUpdate(). As a result the generated compressed output would be a compressed version of the same input chunk. Tests failed to catch this error because the data would comfortably fit within the default buffer size, as a single chunk. Tests have been added to provide adequate coverage of multi-chunk compression. WriteDataToArchiveLZ4() which is also using LZ4F_compressUpdate() did not suffer from this omission. Author: Georgios Kokolatos <gkokolatos@pm.me> Reported-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/ZFhCyn4Gm2eu60rB%40paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_dump/compress_io.h | modified | +7 −1 |
| src/bin/pg_dump/compress_lz4.c | modified | +2 −0 |
| src/bin/pg_dump/t/002_pg_dump.pl | modified | +46 −0 |
Discussion
- Add LZ4 compression in pg_dump 205 messages · 2022-02-25 → 2025-10-14