From a12680207fa9833b5344fb996b6938e9546894cc Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sun, 14 Nov 2021 09:39:24 +0800 Subject: [PATCH] try to fix ubigint percentile range --- src/query/inc/qPercentile.h | 2 +- src/query/src/qPercentile.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/query/inc/qPercentile.h b/src/query/inc/qPercentile.h index f5b770593c..55085c0404 100644 --- a/src/query/inc/qPercentile.h +++ b/src/query/inc/qPercentile.h @@ -33,7 +33,7 @@ typedef struct MinMaxEntry { union { double dMaxVal; int64_t i64MaxVal; - int64_t u64MaxVal; + uint64_t u64MaxVal; }; } MinMaxEntry; diff --git a/src/query/src/qPercentile.c b/src/query/src/qPercentile.c index 024ba77de1..4fc4c90594 100644 --- a/src/query/src/qPercentile.c +++ b/src/query/src/qPercentile.c @@ -67,7 +67,7 @@ static int32_t setBoundingBox(MinMaxEntry* range, int16_t type, double minval, d if (IS_SIGNED_NUMERIC_TYPE(type)) { range->i64MinVal = (int64_t) minval; - if (maxval > INT64_MAX || (int64_t)maxval == INT64_MIN) { + if ((int64_t)maxval > INT64_MAX || (int64_t)maxval == INT64_MIN) { range->i64MaxVal = INT64_MAX; } else { range->i64MaxVal = (int64_t) maxval; @@ -146,7 +146,7 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) { } int32_t tBucketUintHash(tMemBucket *pBucket, const void *value) { - int64_t v = 0; + uint64_t v = 0; GET_TYPED_DATA(v, uint64_t, pBucket->type, value); int32_t index = -1; -- GitLab