This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch dev-1.0.0 in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
commit fc7437683d88a4c069ee7958ad9c57be172f4575 Author: HappenLee <happen...@hotmail.com> AuthorDate: Fri Feb 25 11:03:42 2022 +0800 [Bug] Double/Float % 0 should be NULL (#8230) Co-authored-by: lihaopeng <lihaop...@baidu.com> --- be/src/exprs/arithmetic_expr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/exprs/arithmetic_expr.cpp b/be/src/exprs/arithmetic_expr.cpp index 06546c2..dc4399b 100644 --- a/be/src/exprs/arithmetic_expr.cpp +++ b/be/src/exprs/arithmetic_expr.cpp @@ -113,7 +113,7 @@ FloatVal ModExpr::get_float_val(ExprContext* context, TupleRow* row) { return FloatVal::null(); } FloatVal v2 = _children[1]->get_float_val(context, row); - if (v2.is_null) { + if (v2.is_null || v2.val == 0) { return FloatVal::null(); } return FloatVal(fmod(v1.val, v2.val)); @@ -125,7 +125,7 @@ DoubleVal ModExpr::get_double_val(ExprContext* context, TupleRow* row) { return DoubleVal::null(); } DoubleVal v2 = _children[1]->get_double_val(context, row); - if (v2.is_null) { + if (v2.is_null || v2.val == 0) { return DoubleVal::null(); } return DoubleVal(fmod(v1.val, v2.val)); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org