fix time expression with invalid parameter bug

This commit is contained in:
st0
2021-10-28 10:51:42 +08:00
committed by LINxiansheng
parent 895dd33532
commit b01b3ee539
2 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,7 @@ int ObExprTime::calc_result_type1(ObExprResType& type, ObExprResType& type1, ObE
int16_t scale1 = MIN(type1.get_scale(), MAX_SCALE_FOR_TEMPORAL);
int16_t scale = (SCALE_UNKNOWN_YET == scale1) ? MAX_SCALE_FOR_TEMPORAL : scale1;
type.set_scale(scale);
UNUSED(type_ctx);
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN);
return ret;
}

View File

@ -24,6 +24,10 @@ public:
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
virtual int calc_result1(common::ObObj& result, const common::ObObj& time, common::ObExprCtx& expr_ctx) const;
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
virtual common::ObCastMode get_cast_mode() const override
{
return CM_NULL_ON_WARN;
}
static int calc_time(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
private: