Re: [PATCH] Fix minor issues in astreamer_zstd.c

Поиск
Список
Период
Сортировка
От Japin Li
Тема Re: [PATCH] Fix minor issues in astreamer_zstd.c
Дата
Msg-id SYAPR01MB3038A4B6C26ED62562860C03B683A@SYAPR01MB3038.ausprd01.prod.outlook.com
обсуждение исходный текст
Ответ на [PATCH] Fix minor issues in astreamer_zstd.c  ("zengman" <zengman@halodbtech.com>)
Список pgsql-hackers
On Sat, 10 Jan 2026 at 12:59, "zengman" <zengman@halodbtech.com> wrote:
> Hi all,
>
> While reviewing the zstd code, I noticed two minor issues in astreamer_zstd.c that appear to be errors:
>
> First, the file header comment for astreamer_zstd_compressor incorrectly references "lz4 compression" instead of
"zstdcompression" — this looks like a copy-paste error from astreamer_lz4.c.  
> Second, in the astreamer_zstd_decompressor_finalize function, it seems
> there may be an error in parameter passing: the function uses the full
> buffer capacity (bbs_buffer.maxlen) when calling astreamer_content,
> rather than the actual length of decompressed data (zstd_outBuf.pos).
>
> I’ve attached two patches to address these potential issues:
> 0001: Fixes the incorrect comment in the astreamer_zstd.c header

+1

> 0002: Corrects the parameter passed to astreamer_content in astreamer_zstd_decompressor_finalize

Not sure about this — LZ4 and GZIP do the same thing.

Based on the code coverage reports in [0] and [1], it appears that this case
is already covered by existing tests for both LZ4 and GZIP.

[0] https://coverage.postgresql.org/src/fe_utils/astreamer_lz4.c.gcov.html
[1] https://coverage.postgresql.org/src/fe_utils/astreamer_gzip.c.gcov.html

--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.



В списке pgsql-hackers по дате отправления: