Repository: incubator-hawq
Updated Branches:
  refs/heads/master fd0b25dd7 -> 98d48e78d


HAWQ-1077. Table insert hangs due to stack overwrite which is caused by a bug 
in ao snappy code


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/98d48e78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/98d48e78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/98d48e78

Branch: refs/heads/master
Commit: 98d48e78d5b4c57a2557412955a39edbcb2fe3bc
Parents: fd0b25d
Author: Paul Guo <[email protected]>
Authored: Mon Sep 26 16:42:14 2016 +0800
Committer: Paul Guo <[email protected]>
Committed: Tue Sep 27 18:46:06 2016 +0800

----------------------------------------------------------------------
 src/backend/catalog/pg_compression.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/98d48e78/src/backend/catalog/pg_compression.c
----------------------------------------------------------------------
diff --git a/src/backend/catalog/pg_compression.c 
b/src/backend/catalog/pg_compression.c
index b073d00..245fd76 100644
--- a/src/backend/catalog/pg_compression.c
+++ b/src/backend/catalog/pg_compression.c
@@ -430,7 +430,7 @@ snappy_compress_internal(PG_FUNCTION_ARGS)
        size_t                  src_sz = PG_GETARG_INT32(1);
        char                    *dst = PG_GETARG_POINTER(2);
        size_t                  dst_sz = PG_GETARG_INT32(3);
-       size_t                  *dst_used = PG_GETARG_POINTER(4);
+       int32                   *dst_used = PG_GETARG_POINTER(4);
        size_t                  compressed_length;
        snappy_status   retval;
 
@@ -452,14 +452,14 @@ snappy_decompress_internal(PG_FUNCTION_ARGS)
        const char              *src    = PG_GETARG_POINTER(0);
        size_t                  src_sz = PG_GETARG_INT32(1);
        char                    *dst    = PG_GETARG_POINTER(2);
-       int32                   dst_sz = PG_GETARG_INT32(3);
+       size_t                  dst_sz = PG_GETARG_INT32(3);
        int32                   *dst_used = PG_GETARG_POINTER(4);
        size_t                  uncompressed_length;
        snappy_status   retval;
 
        Insist(src_sz > 0 && dst_sz > 0);
 
-       retval = snappy_uncompressed_length((char *) src, (size_t) src_sz,
+       retval = snappy_uncompressed_length(src, src_sz,
                                                                                
&uncompressed_length);
        if (retval != SNAPPY_OK)
                elog_snappy_error(retval, "snappy_uncompressed_length",
@@ -467,8 +467,7 @@ snappy_decompress_internal(PG_FUNCTION_ARGS)
 
        Insist(dst_sz >= uncompressed_length);
 
-       retval = snappy_uncompress((char *) src, src_sz, (char *) dst,
-                                                          
&uncompressed_length);
+       retval = snappy_uncompress(src, src_sz, dst, &uncompressed_length);
        *dst_used = uncompressed_length;
 
        if (retval != SNAPPY_OK)

Reply via email to