diff --git a/src/backend/cdb/cdbappendonlystorageread.c b/src/backend/cdb/cdbappendonlystorageread.c index 1acbd892fcf1317835e5d860e484423c653721ff..ea8ba347a9cab60899a523e8bfe228334f36040e 100755 --- a/src/backend/cdb/cdbappendonlystorageread.c +++ b/src/backend/cdb/cdbappendonlystorageread.c @@ -283,7 +283,7 @@ AppendOnlyStorageRead_FinishOpenFile(AppendOnlyStorageRead *storageRead, errmsg("append-only storage read error on segment file '%s' for relation '%s'", filePathName, storageRead->relationName), errdetail("FileSeek offset = 0. Error code = %d (%s).", - (int) seekResult, strerror((int) seekResult)))); + errno, strerror(errno)))); } storageRead->file = file; diff --git a/src/backend/utils/hyperloglog/gp_hyperloglog.c b/src/backend/utils/hyperloglog/gp_hyperloglog.c index 17284c64deab5390f1725a165c4aab994a828625..ff66c338b889934812e89b158aadb06fa547287c 100644 --- a/src/backend/utils/hyperloglog/gp_hyperloglog.c +++ b/src/backend/utils/hyperloglog/gp_hyperloglog.c @@ -592,6 +592,13 @@ gp_hll_compress_dense(GpHLLCounter hloglog) } return hloglog; } + + if (len < 0) + ereport(ERROR, + (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("LZ compression failed"), + errdetail("LZ compression return value: %d", len))); + memcpy(hloglog->data,dest,len); /* resize the counter to only encompass the compressed data and the struct @@ -649,6 +656,13 @@ gp_hll_compress_dense_unpacked(GpHLLCounter hloglog) } return hloglog; } + + if (len < 0) + ereport(ERROR, + (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("LZ compression failed"), + errdetail("LZ compression return value: %d", len))); + memcpy(hloglog->data, dest, len); /* resize the counter to only encompass the compressed data and the struct