pglz_decompress()

Started by Hadi Moshayedialmost 12 years ago1 messages
#1Hadi Moshayedi
hadi@moshayedi.net

Hello,

The comments in pg_lzcompress.c say that:

* If VARSIZE(x) == rawsize + sizeof(PGLZ_Header), then the data
* is stored uncompressed as plain bytes. Thus, the decompressor
* simply copies rawsize bytes from the location after the
* header to the destination.

But pg_lzdecompress doesn't seem to check explicitly for the VARSIZE(x) ==
rawsize + sizeof(PGLZ_Header) condition. Is it caller's responsibility to
check for this condition before calling pg_lzdecompress(), or does it
happen somehow in pg_lzdecompress()?

Thanks,
-- Hadi