Skip to content

Commit

Permalink
Update divide.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFall authored Mar 13, 2023
1 parent ad5aab9 commit 2900eb6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dbms/src/Functions/divide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ struct TiDBDivideFloatingImpl<A, B, false>
template <typename Result = ResultType>
static Result apply(A a, B b)
{
<<<<<<< HEAD
return static_cast<Result>(a) / b;
=======
/// ref https://github.com/pingcap/tiflash/issues/6462
/// For division of Decimal/Decimal or Int/Decimal or Decimal/Int, we should round the result to make compatible with TiDB.
/// basically refer to https://stackoverflow.com/a/71634489
Expand Down Expand Up @@ -79,7 +76,6 @@ struct TiDBDivideFloatingImpl<A, B, false>
}
else
return static_cast<Result>(x) / d;
>>>>>>> c6d55aff39 (fix(expr): round decimal divide result when return type is Int512 (#7035))
}
template <typename Result = ResultType>
static Result apply(A a, B b, UInt8 & res_null)
Expand Down Expand Up @@ -349,4 +345,4 @@ void registerFunctionDivideIntegralOrZero(FunctionFactory & factory)
factory.registerFunction<FunctionDivideIntegralOrZero>();
}

} // namespace DB
} // namespace DB

0 comments on commit 2900eb6

Please sign in to comment.