diff --git a/src/sql/engine/expr/ob_expr_from_unix_time.cpp b/src/sql/engine/expr/ob_expr_from_unix_time.cpp index 438e089c21..4e30bb91fa 100644 --- a/src/sql/engine/expr/ob_expr_from_unix_time.cpp +++ b/src/sql/engine/expr/ob_expr_from_unix_time.cpp @@ -216,14 +216,14 @@ int ObExprFromUnixTime::eval_fromtime_normal(const ObExpr &expr, usec_val))) { LOG_WARN("failed to get_usec_from_datum", K(ret)); // warn on fail mode - ObCastMode default_cast_mode = CM_NONE; - if (OB_FAIL(ObSQLUtils::get_default_cast_mode(session->get_stmt_type(), session, - default_cast_mode))) { - LOG_WARN("failed to get default cast mode", K(ret)); - } else if (CM_IS_WARN_ON_FAIL(default_cast_mode)) { + ObCastMode cast_mode = CM_NONE; + int tmp_ret = OB_SUCCESS; + if (OB_UNLIKELY(OB_SUCCESS != (tmp_ret = ObSQLUtils::get_default_cast_mode(session->get_stmt_type(), session, cast_mode)))) { + LOG_WARN("get_default_cast_mode failed", K(tmp_ret), K(session->get_stmt_type())); + } else if (CM_IS_WARN_ON_FAIL(cast_mode)) { ret = OB_SUCCESS; - expr_datum.set_null(); } + expr_datum.set_null(); } else { ObTime ob_time; ObDatum tmp_val; diff --git a/src/sql/engine/expr/ob_expr_timestamp_add.cpp b/src/sql/engine/expr/ob_expr_timestamp_add.cpp index 5645173876..6bd5cf4a26 100644 --- a/src/sql/engine/expr/ob_expr_timestamp_add.cpp +++ b/src/sql/engine/expr/ob_expr_timestamp_add.cpp @@ -242,14 +242,14 @@ int calc_timestampadd_expr(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res_datu } } if (OB_FAIL(ret) && OB_NOT_NULL(session)) { - uint64_t cast_mode = 0; - if (OB_FAIL(ObSQLUtils::get_default_cast_mode(session->get_stmt_type(), - session, cast_mode))) { - LOG_WARN("get_default_cast_mode failed", K(ret), K(session->get_stmt_type())); + ObCastMode cast_mode = CM_NONE; + int tmp_ret = OB_SUCCESS; + if (OB_UNLIKELY(OB_SUCCESS != (tmp_ret = ObSQLUtils::get_default_cast_mode(session->get_stmt_type(), session, cast_mode)))) { + LOG_WARN("get_default_cast_mode failed", K(tmp_ret), K(session->get_stmt_type())); } else if (CM_IS_WARN_ON_FAIL(cast_mode)) { ret = OB_SUCCESS; - res_datum.set_null(); } + res_datum.set_null(); } return ret; }