From 32bf5d7cea678f9c359315ed2da790710e043f00 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Mon, 15 Nov 2021 15:31:34 +0800 Subject: [PATCH] Revert "try to fix ubigint percentile range" This reverts commit a12680207fa9833b5344fb996b6938e9546894cc. --- 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 55085c0404..f5b770593c 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 4fc4c90594..024ba77de1 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; -- GitLab