From 70bc8600a9e76e53b258dd08611309e4a04cfa6f Mon Sep 17 00:00:00 2001 From: TengJianPing <18241664+jacktengg@users.noreply.github.com> Date: Wed, 8 Nov 2023 09:05:58 +0800 Subject: [PATCH] [fix](regression) fix regression framework bug: if real test result is negative, it will miss check test result (#25734) --- be/src/vec/functions/function_binary_arithmetic.h | 3 ++- .../decimalv3/test_agg_keys_schema_change_decimalv3.out | 2 +- .../groovy/org/apache/doris/regression/util/OutputUtils.groovy | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/be/src/vec/functions/function_binary_arithmetic.h b/be/src/vec/functions/function_binary_arithmetic.h index 7198a08bb222ec..911704718fb1e6 100644 --- a/be/src/vec/functions/function_binary_arithmetic.h +++ b/be/src/vec/functions/function_binary_arithmetic.h @@ -79,7 +79,8 @@ struct OperationTraits { std::is_same_v>; static constexpr bool can_overflow = (is_plus_minus || is_multiply) && - (IsDecimalV2 || IsDecimalV2 || IsDecimal256 || IsDecimal256); + (IsDecimalV2 || IsDecimalV2 || IsDecimal128I || IsDecimal128I || + IsDecimal256 || IsDecimal256); static constexpr bool has_variadic_argument = !std::is_void_v()))>; }; diff --git a/regression-test/data/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.out b/regression-test/data/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.out index 1b9f52fd5ea3bb..fc5d8e286ce89b 100644 --- a/regression-test/data/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.out +++ b/regression-test/data/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.out @@ -18,7 +18,7 @@ 0.11111111111111111111111111111111100000 11111111111111111111111111111.1100000000 0.11111111111111111111111111111111100000 11111111111111111111111111111.110 -- !sql -- -0.11111111111111111111111111111111100000 9223372036854775.807 0.11111111111111111111111111111111100000 11111111111111111111111111111.110 +0.11111111111111111111111111111111100000 -999999999999999.999 0.11111111111111111111111111111111100000 11111111111111111111111111111.110 -- !sql -- 0.11111111111111111111111111111111100000 -9223.372036854775808 0.11111111111111111111111111111111100000 11111111111111111111111111111.110 diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy index 757a4a593f8cc2..b140673e7a762e 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy @@ -76,7 +76,7 @@ class OutputUtils { double expectDouble = Double.parseDouble(expectCell) double realDouble = Double.parseDouble(realCell) - double realRelativeError = Math.abs(expectDouble - realDouble) / realDouble + double realRelativeError = Math.abs(expectDouble - realDouble) / Math.abs(realDouble) double expectRelativeError = 1e-8 if (expectRelativeError < realRelativeError) {