patch 4.0
This commit is contained in:
@ -17,43 +17,54 @@
|
||||
#include "share/object/ob_obj_cast.h"
|
||||
#include "sql/engine/expr/ob_expr_operator.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFromUnixTime : public ObFuncExprOperator {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
class ObExprFromUnixTime : public ObFuncExprOperator
|
||||
{
|
||||
public:
|
||||
explicit ObExprFromUnixTime(common::ObIAllocator& alloc);
|
||||
explicit ObExprFromUnixTime(common::ObIAllocator &alloc);
|
||||
virtual ~ObExprFromUnixTime();
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* params, int64_t params_count, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_resultN(
|
||||
common::ObObj& result, const common::ObObj* params, int64_t params_count, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int calc_result_typeN(ObExprResType &type,
|
||||
ObExprResType *params,
|
||||
int64_t params_count,
|
||||
common::ObExprTypeCtx &type_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override;
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_one_temporal_fromtime(const ObExpr &expr,
|
||||
ObEvalCtx &eval_ctx,
|
||||
ObDatum &expr_datum);
|
||||
|
||||
static int eval_one_temporal_fromtime(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum);
|
||||
static int eval_one_param_fromtime(const ObExpr &expr,
|
||||
ObEvalCtx &eval_ctx,
|
||||
ObDatum &expr_datum);
|
||||
|
||||
static int eval_one_param_fromtime(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum);
|
||||
|
||||
static int eval_fromtime_normal(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum);
|
||||
|
||||
static int eval_fromtime_special(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum);
|
||||
static int eval_fromtime_normal(const ObExpr &expr,
|
||||
ObEvalCtx &eval_ctx,
|
||||
ObDatum &expr_datum);
|
||||
|
||||
static int eval_fromtime_special(const ObExpr &expr,
|
||||
ObEvalCtx &eval_ctx,
|
||||
ObDatum &expr_datum);
|
||||
private:
|
||||
static int calc(
|
||||
common::ObObj& result, const common::ObObj& param, const common::ObObj& format, common::ObExprCtx& expr_ctx);
|
||||
static int get_usec(const common::ObObj& param, common::ObExprCtx& expr_ctx, int64_t& value);
|
||||
int set_scale_for_single_param(ObExprResType& type, const ObExprResType& type1) const;
|
||||
int set_scale_for_single_param(ObExprResType &type,
|
||||
const ObExprResType &type1) const;
|
||||
|
||||
common::ObObjType calc_one_param_type(ObExprResType* params) const;
|
||||
common::ObObjType calc_one_param_type(ObExprResType *params) const;
|
||||
|
||||
static int get_usec_from_datum(const common::ObDatum& param_datum, common::ObIAllocator& alloc, int64_t& value);
|
||||
static int get_usec_from_datum(const common::ObDatum ¶m_datum,
|
||||
common::ObIAllocator &alloc,
|
||||
int64_t &value);
|
||||
|
||||
// static int eval_two_
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFromUnixTime);
|
||||
};
|
||||
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ENGINE_EXPR_OB_EXPR_FROM_UNIX_TIME_H_ */
|
||||
|
||||
Reference in New Issue
Block a user