patch 4.0
This commit is contained in:
@ -14,32 +14,39 @@
|
||||
#define SRC_SQL_ENGINE_EXPR_OB_EXPR_FROM_DAYS_H_
|
||||
|
||||
#include "sql/engine/expr/ob_expr_operator.h"
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFromDays : public ObFuncExprOperator {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
class ObExprFromDays : public ObFuncExprOperator
|
||||
{
|
||||
public:
|
||||
explicit ObExprFromDays(common::ObIAllocator& alloc);
|
||||
explicit ObExprFromDays(common::ObIAllocator &alloc);
|
||||
virtual ~ObExprFromDays();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& date, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& date, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_fromdays(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int calc_result_type1(ObExprResType &type,
|
||||
ObExprResType &date,
|
||||
common::ObExprTypeCtx &type_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override;
|
||||
static int calc_fromdays(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFromDays);
|
||||
};
|
||||
inline int ObExprFromDays::calc_result_type1(
|
||||
ObExprResType& type, ObExprResType& date, common::ObExprTypeCtx& type_ctx) const
|
||||
|
||||
inline int ObExprFromDays::calc_result_type1(ObExprResType &type, ObExprResType &date, common::ObExprTypeCtx &type_ctx) const
|
||||
{
|
||||
UNUSED(type_ctx);
|
||||
UNUSED(date);
|
||||
type.set_date();
|
||||
type.set_scale(common::DEFAULT_SCALE_FOR_DATE);
|
||||
// set calc type
|
||||
//set calc type
|
||||
date.set_calc_type(common::ObInt32Type);
|
||||
return common::OB_SUCCESS;
|
||||
}
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* SRC_SQL_ENGINE_EXPR_OB_EXPR_FROM_DAYS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user