[scn] fix failure of mittest after refresh feature scn

This commit is contained in:
obdev
2022-11-28 01:46:42 +00:00
committed by ob-robot
parent 49a02f3304
commit 54b64a7263
1898 changed files with 255804 additions and 280809 deletions

View File

@ -60,12 +60,14 @@ inline int ObExprTimeBase::calc_result_type1(ObExprResType &type,
ObExprResType &type1,
common::ObExprTypeCtx &type_ctx) const
{
UNUSED(type_ctx);
UNUSED(type1);
type.set_int32();
type.set_precision(4);
type.set_scale(0);
common::ObObjTypeClass tc1 = ob_obj_type_class(type1.get_type());
if (common::ObEnumSetTC == tc1) {
type1.set_calc_type_default_varchar();
if (ob_is_enumset_tc(type1.get_type())) {
type1.set_calc_type(common::ObVarcharType);
} else if ((common::ObFloatTC == tc1) || (common::ObDoubleTC == tc1)) {
type1.set_calc_type(common::ObIntType);
}
@ -100,56 +102,22 @@ public:
ObExprSecond();
explicit ObExprSecond(common::ObIAllocator &alloc);
virtual ~ObExprSecond();
virtual int calc_result_type1(ObExprResType &type,
ObExprResType &type1,
common::ObExprTypeCtx &type_ctx) const;
static int calc_second(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
private:
DISALLOW_COPY_AND_ASSIGN(ObExprSecond);
};
inline int ObExprSecond::calc_result_type1(ObExprResType &type,
ObExprResType &type1,
common::ObExprTypeCtx &type_ctx) const
{
type.set_int32();
type.set_precision(4);
type.set_scale(0);
common::ObObjTypeClass tc1 = ob_obj_type_class(type1.get_type());
if ((common::ObEnumSetTC == tc1) || (common::ObFloatTC == tc1) || (common::ObDoubleTC == tc1)) {
type1.set_calc_type_default_varchar();
}
return common::OB_SUCCESS;
}
class ObExprMicrosecond: public ObExprTimeBase
{
public:
ObExprMicrosecond();
explicit ObExprMicrosecond(common::ObIAllocator &alloc);
virtual ~ObExprMicrosecond();
virtual int calc_result_type1(ObExprResType &type,
ObExprResType &type1,
common::ObExprTypeCtx &type_ctx) const;
static int calc_microsecond(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
private:
DISALLOW_COPY_AND_ASSIGN(ObExprMicrosecond);
};
inline int ObExprMicrosecond::calc_result_type1(ObExprResType &type,
ObExprResType &type1,
common::ObExprTypeCtx &type_ctx) const
{
type.set_int32();
type.set_precision(4);
type.set_scale(0);
common::ObObjTypeClass tc1 = ob_obj_type_class(type1.get_type());
if ((common::ObEnumSetTC == tc1) || (common::ObFloatTC == tc1) || (common::ObDoubleTC == tc1)) {
type1.set_calc_type_default_varchar();
}
return common::OB_SUCCESS;
}
class ObExprYear: public ObExprTimeBase
{
public: