修复LZ_UNCOMPRESS_EXTRACT可连续使用

This commit is contained in:
wangpingyun
2024-11-26 14:44:59 +08:00
parent 5dd3744208
commit 0ca45d51f0
2 changed files with 5 additions and 7 deletions

View File

@ -875,19 +875,16 @@ BEGIN
RAISE NOTICE 'v_raw=%', v_raw;
END;
/
NOTICE: content=1F8B080000000000000363540600CC52A5FA02000000
NOTICE: v_raw=0123
ERROR: no compressed data found in handle 1
CONTEXT: PL/pgSQL function gms_compress.lz_uncompress_extract(integer,raw) line 2 at assignment
SQL statement "CALL gms_compress.lz_uncompress_extract(v_handle,v_raw)"
PL/pgSQL function inline_code_block line 9 at SQL statement
DECLARE
content BLOB;
BEGIN
GMS_COMPRESS.LZ_UNCOMPRESS_CLOSE(1);
END;
/
ERROR: handle 1 is not be used
CONTEXT: SQL statement "CALL gms_compress.uncompress_close(handle)"
PL/pgSQL function gms_compress.lz_uncompress_close(integer) line 2 at PERFORM
SQL statement "CALL gms_compress.lz_uncompress_close(1)"
PL/pgSQL function inline_code_block line 3 at PERFORM
DECLARE
content BLOB;
v_handle int;

View File

@ -261,6 +261,7 @@ Datum gms_lz_uncompress_extract(PG_FUNCTION_ARGS)
Size dst_len = 0;
bytea *dst = NULL;
compress_cxt->context[handle].compressed_data = NULL;
gzip_uncompress(src, src_len, (void**)&dst, &dst_len);
SET_VARSIZE(dst, VARHDRSZ + dst_len);