提交 b01b3ee5 编写于 作者: S st0 提交者: LINGuanRen

fix time expression with invalid parameter bug

上级 895dd335
......@@ -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;
}
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册