diff --git a/src/query/inc/qPercentile.h b/src/query/inc/qPercentile.h index 55085c0404c9baa357c2255e1e466dd31e5d4237..f5b770593c1e30df8c3459676ffa42bbfc9cf0ae 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; - uint64_t u64MaxVal; + int64_t u64MaxVal; }; } MinMaxEntry; diff --git a/src/query/src/qPercentile.c b/src/query/src/qPercentile.c index 4fc4c905941210658c599f201b5898ed4295c309..024ba77de13086b7ff8e32ab2c4c7340d8806b6b 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 ((int64_t)maxval > INT64_MAX || (int64_t)maxval == INT64_MIN) { + if (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) { - uint64_t v = 0; + int64_t v = 0; GET_TYPED_DATA(v, uint64_t, pBucket->type, value); int32_t index = -1;