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 4a0cbff commit 1fc4ccd
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 @@ -62,9 +62,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 @@ -93,7 +90,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 @@ -363,4 +359,4 @@ void registerFunctionDivideIntegralOrZero(FunctionFactory & factory)
factory.registerFunction<FunctionDivideIntegralOrZero>();
}

} // namespace DB
} // namespace DB

0 comments on commit 1fc4ccd

Please sign in to comment.