reformat source code
according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
@ -29,7 +29,7 @@ namespace sql {
|
||||
|
||||
template <typename MyClass>
|
||||
class ObConstMap {
|
||||
public:
|
||||
public:
|
||||
typedef int (*InitFunction)(MyClass& member);
|
||||
|
||||
explicit ObConstMap(InitFunction init_f) : is_inited_(false), init_f_(init_f)
|
||||
@ -52,7 +52,7 @@ class ObConstMap {
|
||||
return member_;
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
bool is_inited_;
|
||||
InitFunction init_f_;
|
||||
MyClass member_;
|
||||
|
||||
@ -53,7 +53,7 @@ int padding_char_for_cast(int64_t padding_cnt, const common::ObCollationType& pa
|
||||
common::ObIAllocator& alloc, common::ObString& padding_res);
|
||||
|
||||
class ObDatumHexUtils {
|
||||
public:
|
||||
public:
|
||||
static int hextoraw_string(const ObExpr& expr, const common::ObString& in_str, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
static int hextoraw(const ObExpr& expr, const common::ObDatum& in, const common::ObObjType& in_type,
|
||||
const common::ObCollationType& in_cs_type, ObEvalCtx& ctx, ObDatum& res);
|
||||
@ -68,7 +68,7 @@ class ObDatumHexUtils {
|
||||
};
|
||||
|
||||
class ObDatumCast {
|
||||
public:
|
||||
public:
|
||||
static int get_implicit_cast_function(const common::ObObjType in_type, const common::ObCollationType in_cs_type,
|
||||
const common::ObObjType out_type, const common::ObCollationType out_cs_type, const int64_t cast_mode,
|
||||
ObExpr::EvalFunc& eval_func);
|
||||
@ -109,7 +109,7 @@ class ObDatumCast {
|
||||
};
|
||||
|
||||
class ObDatumCaster {
|
||||
public:
|
||||
public:
|
||||
ObDatumCaster() : inited_(false), eval_ctx_(NULL), cast_expr_(NULL), extra_cast_expr_(NULL)
|
||||
{}
|
||||
~ObDatumCaster()
|
||||
@ -131,7 +131,7 @@ class ObDatumCaster {
|
||||
|
||||
int destroy();
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObDatumCaster);
|
||||
|
||||
// setup following data member of ObExpr:
|
||||
|
||||
@ -37,7 +37,7 @@ typedef ObItemType ObExprOperatorType;
|
||||
struct ObDatumMeta {
|
||||
OB_UNIS_VERSION(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
ObDatumMeta() : type_(common::ObNullType), cs_type_(common::CS_TYPE_INVALID), scale_(-1), precision_(-1)
|
||||
{}
|
||||
ObDatumMeta(const common::ObObjType type, const common::ObCollationType cs_type, const int8_t scale)
|
||||
@ -122,18 +122,18 @@ struct ObEvalCtx {
|
||||
return tmp_alloc_;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
// Allocate expression result memory.
|
||||
void* alloc_expr_res(const int64_t size)
|
||||
{
|
||||
return expr_res_alloc_.alloc(size);
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
char** frames_;
|
||||
ObExecContext& exec_ctx_;
|
||||
|
||||
private:
|
||||
private:
|
||||
// Expression result allocator, never reset.
|
||||
common::ObArenaAllocator& expr_res_alloc_;
|
||||
|
||||
@ -181,7 +181,7 @@ typedef common::ObFixedArray<common::ObString, common::ObIAllocator> ObStrValues
|
||||
struct ObExpr {
|
||||
OB_UNIS_VERSION(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
const static uint32_t INVALID_EXP_CTX_ID = UINT32_MAX;
|
||||
|
||||
ObExpr();
|
||||
@ -249,10 +249,10 @@ struct ObExpr {
|
||||
KP_(inner_functions), K_(inner_func_cnt), K_(arg_cnt), K_(parent_cnt), K_(frame_idx), K_(datum_off),
|
||||
K_(res_buf_off), K_(res_buf_len), K_(expr_ctx_id), K_(extra), KP(this));
|
||||
|
||||
private:
|
||||
private:
|
||||
char* alloc_str_res_mem(ObEvalCtx& ctx, const int64_t size) const;
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef int (*EvalFunc)(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
typedef int (*EvalEnumSetFunc)(const ObExpr& expr, const common::ObIArray<common::ObString>& str_values,
|
||||
const uint64_t cast_mode, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
@ -338,27 +338,27 @@ struct ObExprExtraInfoAccess {
|
||||
// Please try not to use this, if you mast use it, make sure it only allocate one time and is
|
||||
// for expression result.
|
||||
class ObExprStrResAlloc : public common::ObIAllocator {
|
||||
public:
|
||||
public:
|
||||
ObExprStrResAlloc(const ObExpr& expr, ObEvalCtx& ctx) : off_(0), expr_(expr), ctx_(ctx)
|
||||
{}
|
||||
|
||||
void* alloc(const int64_t size) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int64_t off_;
|
||||
const ObExpr& expr_;
|
||||
ObEvalCtx& ctx_;
|
||||
};
|
||||
|
||||
struct ObDatumObj {
|
||||
public:
|
||||
public:
|
||||
void set_scale(common::ObScale scale)
|
||||
{
|
||||
meta_.scale_ = scale;
|
||||
}
|
||||
TO_STRING_KV(K_(meta));
|
||||
|
||||
public:
|
||||
public:
|
||||
ObDatumMeta meta_;
|
||||
common::ObDatum datum_;
|
||||
};
|
||||
@ -374,7 +374,7 @@ struct ObDatumObjParam : public ObDatumObj {
|
||||
|
||||
TO_STRING_KV(K_(accuracy), K_(res_flags), K_(datum), K_(meta));
|
||||
|
||||
public:
|
||||
public:
|
||||
int from_objparam(const common::ObObjParam& objparam);
|
||||
|
||||
int to_objparam(common::ObObjParam& obj_param);
|
||||
@ -498,7 +498,7 @@ struct ObDatumObjParam : public ObDatumObj {
|
||||
return offsetof(ObDatumObjParam, flag_) * 8;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
common::ObAccuracy accuracy_;
|
||||
uint32_t res_flags_; // BINARY, NUM, NOT_NULL, TIMESTAMP, etc
|
||||
// reference: src/lib/regex/include/mysql_com.h
|
||||
|
||||
@ -20,10 +20,10 @@ namespace sql {
|
||||
class ObExprAbs : public ObExprOperator {
|
||||
typedef int (*abs_func)(common::ObObj& res, const common::ObObj& param, common::ObExprCtx& expr_ctx);
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAbs(common::ObIAllocator& alloc);
|
||||
~ObExprAbs(){};
|
||||
|
||||
@ -37,7 +37,7 @@ class ObExprAbs : public ObExprOperator {
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int set_func_mysql(common::ObObjType param_type);
|
||||
int set_func_oracle(common::ObObjType param_type);
|
||||
// tinyint, mediumint, smallint, int32
|
||||
@ -77,10 +77,10 @@ class ObExprAbs : public ObExprOperator {
|
||||
|
||||
static common::ObObjType calc_param_type(const common::ObObjType orig_param_type, const bool is_oracle_mode);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAbs);
|
||||
|
||||
private:
|
||||
private:
|
||||
abs_func func_;
|
||||
};
|
||||
|
||||
|
||||
@ -17,17 +17,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAcos : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAcos(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAcos();
|
||||
virtual int calc_result_type1(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result1(common::ObObj &result,
|
||||
const common::ObObj &obj,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override;
|
||||
virtual int calc_result_type1(
|
||||
ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const override;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAcos);
|
||||
};
|
||||
|
||||
@ -23,7 +23,7 @@ class ObRawExpr;
|
||||
class ObExprCGCtx;
|
||||
|
||||
class ObExprAdd : public ObArithExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprAdd();
|
||||
explicit ObExprAdd(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_ADD);
|
||||
virtual ~ObExprAdd(){};
|
||||
@ -41,7 +41,7 @@ class ObExprAdd : public ObArithExprOperator {
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
public:
|
||||
public:
|
||||
// very very effective implementation
|
||||
// if false is returned, the addition of multiplication will be stored in res
|
||||
template <typename T1, typename T2, typename T3>
|
||||
@ -86,7 +86,7 @@ class ObExprAdd : public ObArithExprOperator {
|
||||
static int add_datetime(common::ObObj& res, const common::ObObj& left, const common::ObObj& right,
|
||||
common::ObIAllocator* allocator, common::ObScale scale);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int add_int(common::ObObj& res, const common::ObObj& left, const common::ObObj& right,
|
||||
common::ObIAllocator* allocator, common::ObScale scale);
|
||||
static int add_uint(common::ObObj& res, const common::ObObj& left, const common::ObObj& right,
|
||||
@ -102,7 +102,7 @@ class ObExprAdd : public ObArithExprOperator {
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAdd);
|
||||
|
||||
public:
|
||||
public:
|
||||
static int add_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int add_int_int(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int add_int_uint(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
@ -202,7 +202,7 @@ class ObExprAdd : public ObArithExprOperator {
|
||||
}
|
||||
static int add_datetime_datetime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static ObArithFunc add_funcs_[common::ObMaxTC];
|
||||
static ObArithFunc agg_add_funcs_[common::ObMaxTC];
|
||||
static const int64_t SHIFT_OFFSET = 63;
|
||||
@ -211,7 +211,7 @@ class ObExprAdd : public ObArithExprOperator {
|
||||
// Add expr for aggregation, different with ObExprAdd:
|
||||
// No overflow check for float/double type.
|
||||
class ObExprAggAdd : public ObExprAdd {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAggAdd(common::ObIAllocator& alloc) : ObExprAdd(alloc, T_OP_AGG_ADD)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAggParamList : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAggParamList(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAggParamList();
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAggParamList);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAnd : public ObLogicalExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAnd(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAnd(){};
|
||||
|
||||
@ -30,7 +30,7 @@ class ObExprAnd : public ObLogicalExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
static int cacl_res_with_one_param_null(
|
||||
common::ObObj& res, const common::ObObj& left, const common::ObObj& right, common::ObExprCtx& expr_ctx);
|
||||
// disallow copy
|
||||
|
||||
@ -23,7 +23,7 @@ typedef int (*ob_get_cmp_type_func)(common::ObObjType& type, const common::ObObj
|
||||
const common::ObObjType& type2, const common::ObObjType& type3);
|
||||
|
||||
class ObExprArgCase : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprArgCase(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprArgCase();
|
||||
|
||||
@ -54,11 +54,11 @@ class ObExprArgCase : public ObExprOperator {
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprArgCase);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool need_cast_;
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAscii : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAscii(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAscii(){};
|
||||
static int calc(common::ObObj& obj, const common::ObObj& obj1, common::ObExprCtx& expr_ctx);
|
||||
@ -29,12 +29,12 @@ class ObExprAscii : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_ascii_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAscii);
|
||||
};
|
||||
|
||||
class ObExprOrd : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprOrd(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprOrd(){};
|
||||
static int calc(common::ObObj& obj, const common::ObObj& obj1, common::ObExprCtx& expr_ctx);
|
||||
@ -46,7 +46,7 @@ class ObExprOrd : public ObFuncExprOperator {
|
||||
|
||||
static int calc_ord_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprOrd);
|
||||
};
|
||||
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAsin : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAsin(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAsin();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAsin);
|
||||
};
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAssign : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAssign(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAssign();
|
||||
virtual int calc_result_type2(
|
||||
@ -29,7 +29,7 @@ class ObExprAssign : public ObFuncExprOperator {
|
||||
static int calc(common::ObObj& result, const common::ObObj& key, const common::ObObj& value,
|
||||
sql::ObSQLSessionInfo* my_session_, common::ObCastCtx& cast_ctx);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAssign);
|
||||
};
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAtan : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAtan(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAtan();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAtan);
|
||||
};
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprAtan2 : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAtan2(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAtan2();
|
||||
virtual int calc_result_typeN(
|
||||
@ -26,7 +26,7 @@ class ObExprAtan2 : public ObFuncExprOperator {
|
||||
common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAtan2);
|
||||
};
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ class AutoincParam;
|
||||
namespace sql {
|
||||
class ObPhysicalPlanCtx;
|
||||
class ObExprAutoincNextval : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAutoincNextval(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAutoincNextval();
|
||||
|
||||
@ -35,7 +35,7 @@ class ObExprAutoincNextval : public ObFuncExprOperator {
|
||||
|
||||
static int get_uint_value(const ObExpr& input_expr, ObDatum* input_value, bool& is_zero, uint64_t& casted_value);
|
||||
|
||||
private:
|
||||
private:
|
||||
// check to generate auto-inc value or not and cast.
|
||||
static int check_and_cast(common::ObObj& result, const common::ObObj* objs_array, int64_t param_num,
|
||||
common::ObExprCtx& expr_ctx, share::AutoincParam* autoinc_param, bool& is_to_generate, uint64_t& casted_value);
|
||||
|
||||
@ -20,7 +20,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprBetween : public ObRelationalExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprBetween();
|
||||
explicit ObExprBetween(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBetween()
|
||||
@ -30,13 +30,13 @@ class ObExprBetween : public ObRelationalExprOperator {
|
||||
const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBetween);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitAnd : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitAnd(common::ObIAllocator& alloc);
|
||||
ObExprBitAnd(
|
||||
common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num, int32_t dimension);
|
||||
@ -27,15 +27,15 @@ class ObExprBitAnd : public ObBitwiseExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitAnd);
|
||||
};
|
||||
|
||||
class ObExprBitAndOra : public ObExprBitAnd {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitAndOra(common::ObIAllocator& alloc);
|
||||
// use cg_expr in ObExprBitAnd
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitAndOra);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitCount : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitCount(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitCount();
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprBitCount : public ObBitwiseExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_bitcount_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static const uint8_t char_to_num_bits[256];
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitCount);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitLeftShift : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitLeftShift(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitLeftShift(){};
|
||||
|
||||
@ -26,7 +26,7 @@ class ObExprBitLeftShift : public ObBitwiseExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitLeftShift);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitLength : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprBitLength();
|
||||
explicit ObExprBitLength(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitLength();
|
||||
@ -28,7 +28,7 @@ class ObExprBitLength : public ObFuncExprOperator {
|
||||
static int calc_null(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int calc_bit_length(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitLength);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitNeg : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitNeg(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitNeg(){};
|
||||
|
||||
@ -26,7 +26,7 @@ class ObExprBitNeg : public ObBitwiseExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_bitneg_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitNeg);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,14 +18,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitOr : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitOr(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitOr(){};
|
||||
virtual int calc_result2(
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitOr);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBitRightShift : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitRightShift(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitRightShift(){};
|
||||
|
||||
@ -26,7 +26,7 @@ class ObExprBitRightShift : public ObBitwiseExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitRightShift);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
// bitwise xor
|
||||
class ObExprBitXor : public ObBitwiseExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBitXor(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBitXor(){};
|
||||
|
||||
@ -28,7 +28,7 @@ class ObExprBitXor : public ObBitwiseExprOperator {
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBitXor);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprBool : public ObLogicalExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBool(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprBool();
|
||||
|
||||
@ -28,7 +28,7 @@ class ObExprBool : public ObLogicalExprOperator {
|
||||
ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBool);
|
||||
};
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ namespace sql {
|
||||
struct CalcPartitionIdInfo : public ObIExprExtraInfo {
|
||||
OB_UNIS_VERSION(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
CalcPartitionIdInfo(common::ObIAllocator& alloc, ObExprOperatorType type)
|
||||
: ObIExprExtraInfo(alloc, type),
|
||||
ref_table_id_(common::OB_INVALID_ID),
|
||||
@ -54,7 +54,7 @@ struct CalcPartitionIdInfo : public ObIExprExtraInfo {
|
||||
|
||||
// return NONE_PARTITION_ID(-1) if part id not found
|
||||
class ObExprCalcPartitionId : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
static const int64_t NONE_PARTITION_ID = -1;
|
||||
enum OptRouteType { OPT_ROUTE_NONE, OPT_ROUTE_HASH_ONE };
|
||||
explicit ObExprCalcPartitionId(common::ObIAllocator& alloc);
|
||||
@ -67,7 +67,7 @@ class ObExprCalcPartitionId : public ObFuncExprOperator {
|
||||
static int calc_partition_level_two(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
static int calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int init_calc_part_info(
|
||||
ObExprCGCtx& expr_cg_ctx, const share::schema::ObTableSchema& table_schema, CalcPartitionIdInfo*& calc_part_info);
|
||||
static int build_row(ObEvalCtx& ctx, common::ObIAllocator& allocator, const ObExpr& expr, common::ObNewRow& row);
|
||||
@ -78,7 +78,7 @@ class ObExprCalcPartitionId : public ObFuncExprOperator {
|
||||
static int enable_opt_route_hash_one(
|
||||
const share::schema::ObTableSchema& table_schema, const ObRawExpr& raw_expr, bool& enable_opt_route_hash_one);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCalcPartitionId);
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCalcURowID : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCalcURowID(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCalcURowID();
|
||||
|
||||
@ -32,7 +32,7 @@ class ObExprCalcURowID : public ObExprOperator {
|
||||
|
||||
static int calc_urowid(const ObExpr& rt_expr, ObEvalCtx& eva_ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCalcURowID);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCardinality : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCardinality(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCardinality();
|
||||
int assign(const ObExprOperator& other);
|
||||
@ -26,7 +26,7 @@ class ObExprCardinality : public ObFuncExprOperator {
|
||||
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCardinality);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -22,7 +22,7 @@ namespace sql {
|
||||
#define NEED_CHECK_WHEN_EXPR_TYPE(flag) (((flag)&CHECK_WHEN_EXPR_TYPE) != 0)
|
||||
|
||||
class ObExprCase : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCase(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCase();
|
||||
|
||||
@ -37,7 +37,7 @@ class ObExprCase : public ObExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int is_same_kind_type_for_case(const common::ObIArray<ObExprResType>& type_arr);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCase);
|
||||
};
|
||||
|
||||
@ -52,7 +52,7 @@ class ObExprCast : public ObFuncExprOperator {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
const static int32_t OB_LITERAL_MAX_INT_LEN = 21;
|
||||
|
||||
public:
|
||||
public:
|
||||
ObExprCast();
|
||||
explicit ObExprCast(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCast(){};
|
||||
@ -71,13 +71,13 @@ class ObExprCast : public ObFuncExprOperator {
|
||||
extra_serialize_ = v ? 1 : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
int check_target_type_precision_valid(const ObExprResType& type, const common::ObCastMode cast_mode) const;
|
||||
int get_cast_type(const ObExprResType param_type2, ObExprResType& dst_type) const;
|
||||
int get_explicit_cast_cm(const ObExprResType& src_type, const ObExprResType& dst_type,
|
||||
const ObSQLSessionInfo& session, const ObRawExpr& cast_raw_expr, common::ObCastMode& cast_mode) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
int get_cast_string_len(ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx, int32_t& res_len,
|
||||
int16_t& length_semantics, common::ObCollationType conn) const;
|
||||
int get_cast_inttc_len(ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx, int32_t& res_len,
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprChar : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprChar(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprChar();
|
||||
virtual int calc_result_typeN(
|
||||
@ -26,7 +26,7 @@ class ObExprChar : public ObFuncExprOperator {
|
||||
common::ObObj& result, const common::ObObj* objs_array, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int calc_result_type(ObExprResType& type, ObExprResType& type1) const;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprChar);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCharLength : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCharLength(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCharLength();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprCharLength : public ObFuncExprOperator {
|
||||
static int eval_char_length(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res);
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCharLength);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprChr : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprChr(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprChr();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -28,7 +28,7 @@ class ObExprChr : public ObStringExprOperator {
|
||||
static int number2varchar(common::ObString& str_result, const double text, common::ObIAllocator& alloc);
|
||||
static int calc_chr_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprChr);
|
||||
};
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ class ObDatum;
|
||||
namespace sql {
|
||||
typedef int (*DatumCmpFunc)(const common::ObDatum& datum1, const common::ObDatum& datum2);
|
||||
class ObExprCmpFuncsHelper {
|
||||
public:
|
||||
public:
|
||||
static sql::ObExpr::EvalFunc get_eval_expr_cmp_func(const common::ObObjType type1, const common::ObObjType type2,
|
||||
const common::ObCmpOp cmp_op, const bool is_oracle_mode, const common::ObCollationType cs_type);
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCoalesce : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCoalesce(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCoalesce();
|
||||
virtual int calc_result_typeN(
|
||||
@ -29,7 +29,7 @@ class ObExprCoalesce : public ObExprOperator {
|
||||
static int calc(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num,
|
||||
const ObExprResType& expected_type, common::ObCastCtx& cast_ctx);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCoalesce);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -20,7 +20,7 @@ namespace sql {
|
||||
class ObExprCollPred : public ObExprOperator {
|
||||
OB_UNIS_VERSION(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCollPred(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCollPred();
|
||||
|
||||
@ -55,10 +55,10 @@ class ObExprCollPred : public ObExprOperator {
|
||||
const ObExprCalcType calc_type, CollectionPredRes& result);
|
||||
static int compare_obj(const ObObj& obj1, const ObObj& obj2, ObCompareCtx& cmp_ctx);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCollPred);
|
||||
|
||||
private:
|
||||
private:
|
||||
ObMultiSetType ms_type_;
|
||||
ObMultiSetModifier ms_modifier_;
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
/// Returns the character set of the string argument.
|
||||
class ObExprCharset : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
// ObExprCharset();
|
||||
explicit ObExprCharset(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCharset();
|
||||
@ -27,19 +27,19 @@ class ObExprCharset : public ObStringExprOperator {
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCharset);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
/// Returns the collation of the string argument.
|
||||
class ObExprCollation : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
// ObExprCollation();
|
||||
explicit ObExprCollation(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCollation();
|
||||
@ -48,20 +48,20 @@ class ObExprCollation : public ObStringExprOperator {
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCollation);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
/// Returns the collation coercibility value of the string argument.
|
||||
/// @see ObCollationLevel
|
||||
class ObExprCoercibility : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
// ObExprCoercibility();
|
||||
explicit ObExprCoercibility(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCoercibility();
|
||||
@ -70,13 +70,13 @@ class ObExprCoercibility : public ObExprOperator {
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCoercibility);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@ class ObExprCoercibility : public ObExprOperator {
|
||||
/// used to implement COLLATE clause, e.g. C1 collate utf8_general_ci, 'abc' collate utf8_bin
|
||||
/// format: SET_COLLATION(expr, utf8_general_ci)
|
||||
class ObExprSetCollation : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
// ObExprSetCollation();
|
||||
explicit ObExprSetCollation(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprSetCollation();
|
||||
@ -95,20 +95,20 @@ class ObExprSetCollation : public ObExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprSetCollation);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
/// Returns the meta used for comparison
|
||||
/// @note for debug purpose
|
||||
class ObExprCmpMeta : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
// ObExprCmpMeta();
|
||||
explicit ObExprCmpMeta(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCmpMeta();
|
||||
@ -117,13 +117,13 @@ class ObExprCmpMeta : public ObStringExprOperator {
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// types and constants
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCmpMeta);
|
||||
// function members
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObBaseExprColumnConv {
|
||||
public:
|
||||
public:
|
||||
ObBaseExprColumnConv(common::ObIAllocator& alloc) : alloc_(alloc), str_values_(alloc_)
|
||||
{}
|
||||
virtual ~ObBaseExprColumnConv()
|
||||
@ -39,14 +39,14 @@ class ObBaseExprColumnConv {
|
||||
ObBaseExprColumnConv(const ObBaseExprColumnConv& other) = delete;
|
||||
ObBaseExprColumnConv& operator=(const ObBaseExprColumnConv& other) = delete;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
common::ObIAllocator& alloc_;
|
||||
common::ObFixedArray<common::ObString, common::ObIAllocator> str_values_;
|
||||
};
|
||||
|
||||
// fast column convert is a optimized form of OExprColumnConvert
|
||||
class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObFastColumnConvExpr(common::ObIAllocator& alloc);
|
||||
virtual ~ObFastColumnConvExpr()
|
||||
{}
|
||||
@ -83,7 +83,7 @@ class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOpera
|
||||
}
|
||||
VIRTUAL_TO_STRING_KV(K_(column_type), K_(value_item), K_(column_info));
|
||||
|
||||
private:
|
||||
private:
|
||||
ObExprResType column_type_;
|
||||
ObPostExprItem value_item_;
|
||||
ObString column_info_;
|
||||
@ -92,7 +92,7 @@ class ObFastColumnConvExpr : public ObBaseExprColumnConv, public ObFastExprOpera
|
||||
class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
// objs[0] type
|
||||
// objs[1] collation_type
|
||||
// objs[2] accuray_expr
|
||||
@ -104,7 +104,7 @@ class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator
|
||||
static const int64_t PARAMS_COUNT_WITHOUT_COLUMN_INFO = 5;
|
||||
static const int64_t PARAMS_COUNT_WITH_COLUMN_INFO = 6;
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObExprColumnConv(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprColumnConv();
|
||||
virtual int calc_result_typeN(
|
||||
@ -119,7 +119,7 @@ class ObExprColumnConv : public ObBaseExprColumnConv, public ObFuncExprOperator
|
||||
const ObString* column_info = NULL);
|
||||
static int column_convert(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprColumnConv) const;
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprConcat : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprConcat(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConcat();
|
||||
|
||||
@ -42,7 +42,7 @@ class ObExprConcat : public ObStringExprOperator {
|
||||
|
||||
static int eval_concat(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprConcat);
|
||||
};
|
||||
|
||||
@ -17,7 +17,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
// stands for Concatenate With Separator and is a special form of CONCAT()
|
||||
class ObExprConcatWs : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprConcatWs();
|
||||
explicit ObExprConcatWs(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConcatWs();
|
||||
@ -36,7 +36,7 @@ class ObExprConcatWs : public ObStringExprOperator {
|
||||
static int calc(const common::ObString& sep_str, const common::ObIArray<common::ObString>& words,
|
||||
common::ObIAllocator& alloc, common::ObString& res_str);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprConcatWs);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprConnectByRoot : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprConnectByRoot(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConnectByRoot()
|
||||
{}
|
||||
@ -30,7 +30,7 @@ class ObExprConnectByRoot : public ObExprOperator {
|
||||
|
||||
static int eval_connect_by_root(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprConnectByRoot) const;
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprConnectionId : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprConnectionId(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConnectionId();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprConnectionId : public ObFuncExprOperator {
|
||||
static int eval_connection_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprConnectionId);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprConv : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprConv(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConv();
|
||||
virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3,
|
||||
@ -27,7 +27,7 @@ class ObExprConv : public ObStringExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_conv(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static const int16_t MIN_BASE = 2;
|
||||
static const int16_t MAX_BASE = 36;
|
||||
static const int16_t MAX_LENGTH = 65;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprConvert : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprConvert(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprConvert();
|
||||
virtual int calc_result_type2(
|
||||
@ -27,7 +27,7 @@ class ObExprConvert : public ObFuncExprOperator {
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprConvert);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -19,14 +19,14 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprCos : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCos(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCos();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& radian, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& radian_obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCos);
|
||||
};
|
||||
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCosh : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCosh(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCosh();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCosh);
|
||||
};
|
||||
|
||||
|
||||
@ -20,13 +20,13 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprOperatorFactory;
|
||||
class ObExprCtxCatAnalyzer {
|
||||
public:
|
||||
public:
|
||||
ObExprCtxCatAnalyzer(ObExprOperatorFactory& expr_factory) : expr_factory_(expr_factory)
|
||||
{}
|
||||
int parse_search_keywords(common::ObObj& keyword_text, ObMatchAgainstMode mode_flag, ObIterExprOperator*& search_tree,
|
||||
common::ObIArray<common::ObObj>& keywords);
|
||||
|
||||
private:
|
||||
private:
|
||||
int create_set_op_tree(
|
||||
common::ObIArray<ObIndexScanIterExpr*>& set_keys, ObItemType set_op_type, ObIterExprOperator*& search_tree);
|
||||
int ft_get_simple_words(
|
||||
@ -34,7 +34,7 @@ class ObExprCtxCatAnalyzer {
|
||||
int ft_get_boolean_words(
|
||||
common::ObObj& keyword_text, ObIterExprOperator*& search_tree, common::ObIArray<common::ObObj>& keywords);
|
||||
|
||||
private:
|
||||
private:
|
||||
ObExprOperatorFactory& expr_factory_;
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprUtcTimestamp : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprUtcTimestamp(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprUtcTimestamp();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,13 +26,13 @@ class ObExprUtcTimestamp : public ObFuncExprOperator {
|
||||
static int eval_utc_timestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprUtcTimestamp);
|
||||
};
|
||||
|
||||
class ObExprCurTimestamp : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCurTimestamp(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCurTimestamp();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -40,13 +40,13 @@ class ObExprCurTimestamp : public ObFuncExprOperator {
|
||||
static int eval_cur_timestamp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCurTimestamp);
|
||||
};
|
||||
|
||||
class ObExprSysdate : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprSysdate(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprSysdate();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const override;
|
||||
@ -54,13 +54,13 @@ class ObExprSysdate : public ObFuncExprOperator {
|
||||
static int eval_sysdate(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprSysdate);
|
||||
};
|
||||
|
||||
class ObExprCurDate : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCurDate(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCurDate();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -68,13 +68,13 @@ class ObExprCurDate : public ObFuncExprOperator {
|
||||
static int eval_cur_date(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCurDate);
|
||||
};
|
||||
|
||||
class ObExprCurTime : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCurTime(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCurTime();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -82,7 +82,7 @@ class ObExprCurTime : public ObFuncExprOperator {
|
||||
static int eval_cur_time(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCurTime);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprCurrentUser : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprCurrentUser(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprCurrentUser();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprCurrentUser : public ObStringExprOperator {
|
||||
static int eval_current_user(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCurrentUser);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDatabase : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDatabase(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDatabase();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprDatabase : public ObStringExprOperator {
|
||||
static int eval_database(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDatabase);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDate : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDate(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDate();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -30,7 +30,7 @@ class ObExprDate : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_date(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDate);
|
||||
};
|
||||
|
||||
@ -17,7 +17,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprDateAdjust : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprDateAdjust(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num,
|
||||
int32_t dimension = NOT_ROW_DIMENSION);
|
||||
|
||||
@ -28,12 +28,12 @@ class ObExprDateAdjust : public ObFuncExprOperator {
|
||||
const common::ObObj& unit, common::ObExprCtx& expr_ctx, bool is_add, const ObExprResType& res_type) const;
|
||||
static int calc_date_adjust(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, bool is_add);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDateAdjust);
|
||||
};
|
||||
|
||||
class ObExprDateAdd : public ObExprDateAdjust {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDateAdd(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDateAdd(){};
|
||||
virtual int calc_result3(common::ObObj& result, const common::ObObj& date, const common::ObObj& interval,
|
||||
@ -41,12 +41,12 @@ class ObExprDateAdd : public ObExprDateAdjust {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_date_add(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDateAdd);
|
||||
};
|
||||
|
||||
class ObExprDateSub : public ObExprDateAdjust {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDateSub(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDateSub(){};
|
||||
virtual int calc_result3(common::ObObj& result, const common::ObObj& date, const common::ObObj& interval,
|
||||
@ -54,12 +54,12 @@ class ObExprDateSub : public ObExprDateAdjust {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_date_sub(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDateSub);
|
||||
};
|
||||
|
||||
class ObExprAddMonths : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAddMonths(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAddMonths()
|
||||
{}
|
||||
@ -70,12 +70,12 @@ class ObExprAddMonths : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_add_months(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprAddMonths);
|
||||
};
|
||||
|
||||
class ObExprLastDay : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprLastDay(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprLastDay()
|
||||
{}
|
||||
@ -84,12 +84,12 @@ class ObExprLastDay : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_last_day(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprLastDay);
|
||||
};
|
||||
|
||||
class ObExprNextDay : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprNextDay(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprNextDay()
|
||||
{}
|
||||
@ -100,7 +100,7 @@ class ObExprNextDay : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_next_day(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprNextDay);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDateDiff : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDateDiff(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDateDiff();
|
||||
virtual int calc_result_type2(
|
||||
@ -33,7 +33,7 @@ class ObExprDateDiff : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_date_diff(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDateDiff);
|
||||
};
|
||||
@ -54,7 +54,7 @@ inline int ObExprDateDiff::calc_result_type2(
|
||||
}
|
||||
|
||||
class ObExprMonthsBetween : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprMonthsBetween(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprMonthsBetween();
|
||||
virtual int calc_result_type2(
|
||||
@ -64,7 +64,7 @@ class ObExprMonthsBetween : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_months_between(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprMonthsBetween);
|
||||
};
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDateFormat : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDateFormat(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDateFormat();
|
||||
virtual int calc_result_type2(
|
||||
@ -31,7 +31,7 @@ class ObExprDateFormat : public ObStringExprOperator {
|
||||
static int calc_date_format(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int calc_date_format_invalid(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDateFormat);
|
||||
|
||||
|
||||
@ -19,40 +19,40 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprDayOfMonth : public ObExprTimeBase {
|
||||
public:
|
||||
public:
|
||||
ObExprDayOfMonth();
|
||||
explicit ObExprDayOfMonth(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDayOfMonth();
|
||||
static int calc_dayofmonth(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDayOfMonth);
|
||||
};
|
||||
|
||||
class ObExprDayOfWeek : public ObExprTimeBase {
|
||||
public:
|
||||
public:
|
||||
ObExprDayOfWeek();
|
||||
explicit ObExprDayOfWeek(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDayOfWeek();
|
||||
static int calc_dayofweek(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDayOfWeek);
|
||||
};
|
||||
|
||||
class ObExprDayOfYear : public ObExprTimeBase {
|
||||
public:
|
||||
public:
|
||||
ObExprDayOfYear();
|
||||
explicit ObExprDayOfYear(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDayOfYear();
|
||||
static int calc_dayofyear(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDayOfYear);
|
||||
};
|
||||
|
||||
class ObExprToSeconds : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprToSeconds();
|
||||
explicit ObExprToSeconds(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprToSeconds();
|
||||
@ -63,7 +63,7 @@ class ObExprToSeconds : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_toseconds(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprToSeconds);
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ inline int ObExprToSeconds::calc_result_type1(
|
||||
}
|
||||
|
||||
class ObExprSecToTime : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprSecToTime();
|
||||
explicit ObExprSecToTime(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprSecToTime();
|
||||
@ -93,7 +93,7 @@ class ObExprSecToTime : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_sectotime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprSecToTime);
|
||||
};
|
||||
|
||||
@ -109,7 +109,7 @@ inline int ObExprSecToTime::calc_result_type1(
|
||||
}
|
||||
|
||||
class ObExprTimeToSec : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprTimeToSec();
|
||||
explicit ObExprTimeToSec(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprTimeToSec();
|
||||
@ -120,7 +120,7 @@ class ObExprTimeToSec : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_timetosec(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprTimeToSec);
|
||||
};
|
||||
|
||||
@ -137,7 +137,7 @@ inline int ObExprTimeToSec::calc_result_type1(
|
||||
}
|
||||
|
||||
class ObExprSubtime : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprSubtime(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprSubtime(){};
|
||||
virtual int calc_result_type2(ObExprResType& type, ObExprResType& date_arg, ObExprResType& time_arg,
|
||||
@ -150,7 +150,7 @@ class ObExprSubtime : public ObFuncExprOperator {
|
||||
static int subtime_datetime(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int subtime_varchar(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprSubtime);
|
||||
};
|
||||
|
||||
|
||||
@ -22,18 +22,18 @@ namespace sql {
|
||||
|
||||
// https://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm#i998484
|
||||
class ObExprDbmsLobGetLength : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobGetLength(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobGetLength();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& lob, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& lob, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobGetLength);
|
||||
};
|
||||
|
||||
class ObExprDbmsLobAppend : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobAppend(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobAppend();
|
||||
virtual int calc_result_type2(
|
||||
@ -43,12 +43,12 @@ class ObExprDbmsLobAppend : public ObStringExprOperator {
|
||||
virtual int calc_result2(
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobAppend);
|
||||
};
|
||||
|
||||
class ObExprDbmsLobRead : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobRead(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobRead();
|
||||
virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3,
|
||||
@ -58,12 +58,12 @@ class ObExprDbmsLobRead : public ObStringExprOperator {
|
||||
virtual int calc_result3(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobRead);
|
||||
};
|
||||
|
||||
class ObExprDbmsLobConvertToBlob : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobConvertToBlob(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobConvertToBlob();
|
||||
virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3,
|
||||
@ -73,24 +73,24 @@ class ObExprDbmsLobConvertToBlob : public ObStringExprOperator {
|
||||
virtual int calc_result3(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
const common::ObObj& obj3, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobConvertToBlob);
|
||||
};
|
||||
|
||||
class ObExprDbmsLobCastClobToBlob : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobCastClobToBlob(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobCastClobToBlob();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& clob, common::ObExprTypeCtx& type_ctx) const;
|
||||
static int calc(common::ObObj& result, const common::ObObj& obj, common::ObCastCtx& cast_ctx);
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& clob, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobCastClobToBlob);
|
||||
};
|
||||
|
||||
class ObExprDbmsLobConvertClobCharset : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDbmsLobConvertClobCharset(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDbmsLobConvertClobCharset();
|
||||
virtual int calc_result_type2(
|
||||
@ -100,7 +100,7 @@ class ObExprDbmsLobConvertClobCharset : public ObStringExprOperator {
|
||||
virtual int calc_result2(
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDbmsLobConvertClobCharset);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDesHexStr : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDesHexStr(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprDesHexStr()
|
||||
{}
|
||||
@ -30,11 +30,11 @@ class ObExprDesHexStr : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_des_hex_str(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int deserialize_hex_cstr(
|
||||
const char* buf, int64_t buf_len, common::ObExprStringBuf& string_buf, common::ObObj& obj);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDesHexStr);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprDiv : public ObArithExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprDiv();
|
||||
explicit ObExprDiv(common::ObIAllocator& alloc, ObExprOperatorType type = T_OP_DIV);
|
||||
virtual ~ObExprDiv()
|
||||
@ -58,7 +58,7 @@ class ObExprDiv : public ObArithExprOperator {
|
||||
ObEvalCtx& ctx, const ObExpr& expr);
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprDiv);
|
||||
|
||||
private:
|
||||
private:
|
||||
static ObArithFunc div_funcs_[common::ObMaxTC];
|
||||
static ObArithFunc avg_div_funcs_[common::ObMaxTC];
|
||||
static const common::ObScale DIV_CALC_SCALE;
|
||||
@ -68,7 +68,7 @@ class ObExprDiv : public ObArithExprOperator {
|
||||
// Div expr for aggregation, different with ObExprDiv:
|
||||
// No overflow check for double type.
|
||||
class ObExprAggDiv : public ObExprDiv {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprAggDiv(common::ObIAllocator& alloc) : ObExprDiv(alloc, T_OP_AGG_DIV)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -28,7 +28,7 @@ class ObSqlExpression;
|
||||
class ObExprDllUdf : public ObFuncExprOperator {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObExprDllUdf(ObIAllocator& alloc);
|
||||
ObExprDllUdf(ObIAllocator& alloc, ObExprOperatorType type, const char* name);
|
||||
virtual ~ObExprDllUdf();
|
||||
@ -38,7 +38,7 @@ class ObExprDllUdf : public ObFuncExprOperator {
|
||||
virtual int calc_resultN(
|
||||
common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
public:
|
||||
public:
|
||||
int set_udf_meta(const share::schema::ObUDFMeta& udf);
|
||||
int init_udf(const common::ObIArray<ObRawExpr*>& para_exprs);
|
||||
common::ObIArray<common::ObString>& get_udf_attribute()
|
||||
@ -55,7 +55,7 @@ class ObExprDllUdf : public ObFuncExprOperator {
|
||||
};
|
||||
int add_const_expression(ObSqlExpression* sql_calc, int64_t idx_in_udf_arg);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
common::ObIAllocator& allocator_;
|
||||
ObNormalUdfFunction udf_func_;
|
||||
ObUdfFunction::ObUdfCtx udf_ctx_;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprEffectiveTenant : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprEffectiveTenant(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEffectiveTenant();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprEffectiveTenant : public ObFuncExprOperator {
|
||||
static int eval_effective_tenant(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEffectiveTenant);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprEffectiveTenantId : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprEffectiveTenantId(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEffectiveTenantId();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprEffectiveTenantId : public ObFuncExprOperator {
|
||||
static int eval_effective_tenant_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEffectiveTenantId);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprElt : public ObExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprElt(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprElt(){};
|
||||
|
||||
@ -35,7 +35,7 @@ class ObExprElt : public ObExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_elt(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprElt);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprEmptyClob : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprEmptyClob(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEmptyClob();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -27,13 +27,13 @@ class ObExprEmptyClob : public ObFuncExprOperator {
|
||||
static int eval_empty_clob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEmptyClob);
|
||||
};
|
||||
|
||||
class ObExprEmptyBlob : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprEmptyBlob(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEmptyBlob();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -41,7 +41,7 @@ class ObExprEmptyBlob : public ObFuncExprOperator {
|
||||
static int eval_empty_blob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEmptyBlob);
|
||||
};
|
||||
|
||||
@ -20,14 +20,14 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprEqual : public ObRelationalExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprEqual();
|
||||
explicit ObExprEqual(common::ObIAllocator &alloc);
|
||||
virtual ~ObExprEqual() {};
|
||||
virtual int calc_result2(common::ObObj &result, const common::ObObj &obj1,
|
||||
const common::ObObj &obj2, common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int calc_resultN(common::ObObj &result, const common::ObObj *objs_stack,
|
||||
int64_t param_num, common::ObExprCtx &expr_ctx) const override;
|
||||
explicit ObExprEqual(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEqual(){};
|
||||
virtual int calc_result2(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
common::ObExprCtx& expr_ctx) const override;
|
||||
virtual int calc_resultN(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num,
|
||||
common::ObExprCtx& expr_ctx) const override;
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override
|
||||
{
|
||||
@ -35,25 +35,15 @@ class ObExprEqual : public ObRelationalExprOperator {
|
||||
return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr);
|
||||
}
|
||||
|
||||
static int calc(common::ObObj &result,
|
||||
const common::ObObj &obj1,
|
||||
const common::ObObj &obj2,
|
||||
const common::ObCompareCtx &cmp_ctx,
|
||||
common::ObCastCtx &cast_ctx);
|
||||
static int calc_cast(common::ObObj &result,
|
||||
const common::ObObj &obj1,
|
||||
const common::ObObj &obj2,
|
||||
const common::ObCompareCtx &cmp_ctx,
|
||||
common::ObCastCtx &cast_ctx);
|
||||
static int calc_without_cast(common::ObObj &result,
|
||||
const common::ObObj &obj1,
|
||||
const common::ObObj &obj2,
|
||||
const common::ObCompareCtx &cmp_ctx,
|
||||
bool &need_cast);
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
static int calc(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
const common::ObCompareCtx& cmp_ctx, common::ObCastCtx& cast_ctx);
|
||||
static int calc_cast(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
const common::ObCompareCtx& cmp_ctx, common::ObCastCtx& cast_ctx);
|
||||
static int calc_without_cast(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
const common::ObCompareCtx& cmp_ctx, bool& need_cast);
|
||||
virtual int calc_result_type2(
|
||||
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEqual);
|
||||
};
|
||||
|
||||
@ -18,19 +18,15 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprEstimateNdv : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprEstimateNdv(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEstimateNdv();
|
||||
virtual int calc_result_type1(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result1(common::ObObj &result,
|
||||
const common::ObObj &obj,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
static int llc_estimate_ndv(common::ObObj &result, const common::ObObj &obj,
|
||||
common::ObExprCtx &expr_ctx);
|
||||
static void llc_estimate_ndv(int64_t &result, const common::ObString &bitmap_str);
|
||||
static int llc_estimate_ndv(double &estimate_ndv, const common::ObString &bitmap_buf);
|
||||
virtual int calc_result_type1(
|
||||
ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const override;
|
||||
static int llc_estimate_ndv(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx);
|
||||
static void llc_estimate_ndv(int64_t& result, const common::ObString& bitmap_str);
|
||||
static int llc_estimate_ndv(double& estimate_ndv, const common::ObString& bitmap_buf);
|
||||
// high several bits of hash value are used to store bucket_id, the param value must
|
||||
// remove these bits by left shift, the count of valid bits after removing is bit_width.
|
||||
static uint64_t llc_leading_zeros(uint64_t value, uint64_t bit_width);
|
||||
@ -39,13 +35,13 @@ class ObExprEstimateNdv : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_estimate_ndv_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static inline double llc_alpha_times_m_square(const uint64_t m);
|
||||
// the count of buckets should be between 16 and 65536, according to Google's HLLC paper.
|
||||
static const int LLC_NUM_BUCKETS_MIN = (1 << 4);
|
||||
static const int LLC_NUM_BUCKETS_MAX = (1 << 16);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprEstimateNdv);
|
||||
};
|
||||
} /* namespace sql */
|
||||
|
||||
@ -16,22 +16,20 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprExists : public ObSubQueryRelationalExpr {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprExists(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprExists();
|
||||
|
||||
virtual int calc_result_type1(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result1(common::ObObj &result,
|
||||
const common::ObObj &obj1,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int calc_result_type1(
|
||||
ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int calc_result1(
|
||||
common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const override;
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
static int exists_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprExists);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,17 +18,17 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprExp : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprExp(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprExp();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprExp);
|
||||
|
||||
private:
|
||||
private:
|
||||
};
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -22,7 +22,7 @@ namespace sql {
|
||||
class ObIExprExtraInfo;
|
||||
|
||||
struct ObExprExtraInfoFactory {
|
||||
public:
|
||||
public:
|
||||
typedef int (*AllocExtraInfoFunc)(
|
||||
common::ObIAllocator& alloc, ObIExprExtraInfo*& extra_info, const ObExprOperatorType type);
|
||||
// allocate extra info
|
||||
@ -35,11 +35,11 @@ struct ObExprExtraInfoFactory {
|
||||
return type > T_INVALID && type < T_MAX_OP && NULL != ALLOC_FUNS_[type];
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
template <typename T>
|
||||
static int alloc(common::ObIAllocator& alloc, ObIExprExtraInfo*& extra_info, const ObExprOperatorType type);
|
||||
|
||||
private:
|
||||
private:
|
||||
static AllocExtraInfoFunc ALLOC_FUNS_[T_MAX_OP];
|
||||
};
|
||||
|
||||
|
||||
@ -20,36 +20,26 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObPhysicalPlanCtx;
|
||||
class ObExprExtract : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprExtract(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprExtract();
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
ObExprResType &date_unit,
|
||||
ObExprResType &date,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result_type2(ObExprResType& type, ObExprResType& date_unit, ObExprResType& date,
|
||||
common::ObExprTypeCtx& type_ctx) const override;
|
||||
template <typename T>
|
||||
static int calc(T& result, const int64_t date_unit, const T& date, common::ObObjType date_type,
|
||||
const common::ObCastMode cast_mode, const common::ObTimeZoneInfo* tz_info, const int64_t cur_ts_value);
|
||||
template <typename T>
|
||||
static int calc_oracle(T &result,
|
||||
const int64_t date_unit,
|
||||
const T &date,
|
||||
common::ObObjType type,
|
||||
const ObSQLSessionInfo *session,
|
||||
common::ObIAllocator *calc_buf);
|
||||
virtual int calc_result2(common::ObObj &result,
|
||||
const common::ObObj &date_unit,
|
||||
const common::ObObj &date,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override;
|
||||
static int calc_extract_oracle(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
static int calc_extract_mysql(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
static int calc_oracle(T& result, const int64_t date_unit, const T& date, common::ObObjType type,
|
||||
const ObSQLSessionInfo* session, common::ObIAllocator* calc_buf);
|
||||
virtual int calc_result2(common::ObObj& result, const common::ObObj& date_unit, const common::ObObj& date,
|
||||
common::ObExprCtx& expr_ctx) const override;
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_extract_oracle(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int calc_extract_mysql(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
int set_result_type_oracle(common::ObExprTypeCtx &type_ctx,
|
||||
const ObExprResType &date_unit,
|
||||
ObExprResType &res_type) const;
|
||||
int set_result_type_oracle(
|
||||
common::ObExprTypeCtx& type_ctx, const ObExprResType& date_unit, ObExprResType& res_type) const;
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprExtract);
|
||||
};
|
||||
|
||||
@ -19,18 +19,18 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprField : public ObVectorExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprField(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprField(){};
|
||||
virtual int assign(const ObExprOperator& other);
|
||||
|
||||
public:
|
||||
public:
|
||||
// serialize and deserialize
|
||||
virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const;
|
||||
virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos);
|
||||
virtual int64_t get_serialize_size() const;
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* type_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
|
||||
@ -49,10 +49,10 @@ class ObExprField : public ObVectorExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_field(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprField);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool need_cast_;
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprFindInSet : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFindInSet(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFindInSet();
|
||||
virtual int calc_result_type2(
|
||||
@ -29,7 +29,7 @@ class ObExprFindInSet : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_find_in_set_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFindInSet);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObLocale {
|
||||
public:
|
||||
public:
|
||||
uint decimal_point_;
|
||||
uint thousand_sep_;
|
||||
const char* grouping_;
|
||||
@ -34,7 +34,7 @@ class ObLocale {
|
||||
};
|
||||
|
||||
class ObExprFormat : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFormat(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFormat();
|
||||
virtual int calc_result_typeN(
|
||||
@ -44,7 +44,7 @@ class ObExprFormat : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_format_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
int get_origin_param_type(ObExprResType& ori_type) const;
|
||||
int convert_num_to_str(
|
||||
const common::ObObj* objs_array, common::ObExprCtx& expr_ctx, int64_t scale, common::ObString& num_str) const;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFoundRows : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFoundRows(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFoundRows();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -25,7 +25,7 @@ class ObExprFoundRows : public ObFuncExprOperator {
|
||||
static int eval_found_rows(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFoundRows);
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ class ObPhysicalPlanCtx;
|
||||
struct ObFrameInfo {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
ObFrameInfo() : expr_cnt_(0), frame_idx_(0), frame_size_(0)
|
||||
{}
|
||||
|
||||
@ -34,7 +34,7 @@ struct ObFrameInfo {
|
||||
|
||||
TO_STRING_KV(K_(expr_cnt), K_(frame_idx), K_(frame_size));
|
||||
|
||||
public:
|
||||
public:
|
||||
uint64_t expr_cnt_;
|
||||
uint32_t frame_idx_;
|
||||
uint64_t frame_size_;
|
||||
@ -61,7 +61,7 @@ struct ObExprFrameInfo {
|
||||
|
||||
TO_STRING_KV(K_(const_frame_ptrs), K_(const_frame), K_(dynamic_frame), K_(datum_frame));
|
||||
|
||||
public:
|
||||
public:
|
||||
// count of expression need context. exec_ctx pre allocate memory according to it.
|
||||
int64_t need_ctx_cnt_;
|
||||
// all physical expressions generated by expe_code_generator
|
||||
@ -74,13 +74,13 @@ struct ObExprFrameInfo {
|
||||
};
|
||||
|
||||
struct ObPreCalcExprFrameInfo : public ObExprFrameInfo, public common::ObDLinkBase<ObPreCalcExprFrameInfo> {
|
||||
public:
|
||||
public:
|
||||
ObPreCalcExprFrameInfo(common::ObIAllocator& allocator) : ObExprFrameInfo(allocator), pre_calc_rt_exprs_(allocator)
|
||||
{}
|
||||
|
||||
int assign(const ObPreCalcExprFrameInfo& other, common::ObIAllocator& allocator);
|
||||
|
||||
public:
|
||||
public:
|
||||
common::ObFixedArray<ObExpr*, common::ObIAllocator> pre_calc_rt_exprs_;
|
||||
};
|
||||
} // end namespace sql
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFromDays : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFromDays(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFromDays();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& date, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -25,7 +25,7 @@ class ObExprFromDays : public ObFuncExprOperator {
|
||||
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:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFromDays);
|
||||
};
|
||||
inline int ObExprFromDays::calc_result_type1(
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFromTz : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFromTz(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFromTz()
|
||||
{}
|
||||
@ -32,7 +32,7 @@ class ObExprFromTz : public ObFuncExprOperator {
|
||||
static int eval_from_tz(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res);
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFromTz);
|
||||
};
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFromUnixTime : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFromUnixTime(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFromUnixTime();
|
||||
virtual int calc_result_typeN(
|
||||
@ -38,7 +38,7 @@ class ObExprFromUnixTime : public ObFuncExprOperator {
|
||||
|
||||
static int eval_fromtime_special(const ObExpr& expr, ObEvalCtx& eval_ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
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);
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFunDefault : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFunDefault(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFunDefault();
|
||||
virtual int calc_result_typeN(
|
||||
@ -28,7 +28,7 @@ class ObExprFunDefault : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_default_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFunDefault);
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFunValues : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFunValues(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFunValues();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprFunValues : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_values(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFunValues);
|
||||
};
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFuncAddrToPartId : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncAddrToPartId(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncAddrToPartId();
|
||||
|
||||
@ -27,7 +27,7 @@ class ObExprFuncAddrToPartId : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_addr_to_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncAddrToPartId);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -22,7 +22,7 @@ class ObExprCeilFloor : public ObFuncExprOperator {
|
||||
static const int16_t MAX_LIMIT_WITH_SCALE = 17;
|
||||
static const int16_t MAX_LIMIT_WITHOUT_SCALE = 18;
|
||||
|
||||
public:
|
||||
public:
|
||||
ObExprCeilFloor(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num,
|
||||
int32_t dimension = NOT_ROW_DIMENSION);
|
||||
|
||||
@ -32,43 +32,43 @@ class ObExprCeilFloor : public ObFuncExprOperator {
|
||||
common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx, bool is_ceil) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprCeilFloor);
|
||||
};
|
||||
|
||||
class ObExprFuncCeil : public ObExprCeilFloor {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncCeil(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncCeil();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncCeil);
|
||||
};
|
||||
|
||||
class ObExprFuncCeiling : public ObExprCeilFloor {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncCeiling(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncCeiling();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncCeiling);
|
||||
};
|
||||
|
||||
class ObExprFuncFloor : public ObExprCeilFloor {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncFloor(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncFloor();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncFloor);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFuncDump : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncDump(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncDump();
|
||||
virtual int calc_resultN(
|
||||
@ -30,7 +30,7 @@ class ObExprFuncDump : public ObStringExprOperator {
|
||||
|
||||
static int eval_dump(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
int calc_params(const common::ObObj* objs, const int64_t param_num, int64_t& fmt_enum, int64_t& start_pos,
|
||||
int64_t& print_value_len) const;
|
||||
int calc_number(const common::ObObj& input, const int64_t fmt_enum, int64_t& start_pos, int64_t& print_value_len,
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObTaskExecutorCtx;
|
||||
class ObExprFuncPartOldHash : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncPartOldHash(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncPartOldHash();
|
||||
virtual int calc_result_typeN(
|
||||
@ -38,7 +38,7 @@ class ObExprFuncPartOldHash : public ObFuncExprOperator {
|
||||
static int eval_old_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int eval_oracle_old_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, uint64_t seed);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int eval_vt_old_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum,
|
||||
ObTaskExecutorCtx& task_exec_ctx, const uint64_t table_id);
|
||||
static bool is_oracle_supported_type(const common::ObObjType type);
|
||||
@ -50,7 +50,7 @@ class ObExprFuncPartOldHash : public ObFuncExprOperator {
|
||||
// call new hash functions, solve partition row skew problem
|
||||
class ObTaskExecutorCtx;
|
||||
class ObExprFuncPartHash : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncPartHash(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncPartHash();
|
||||
virtual int calc_result_typeN(
|
||||
@ -70,12 +70,12 @@ class ObExprFuncPartHash : public ObFuncExprOperator {
|
||||
static int eval_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int eval_oracle_part_hash(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, uint64_t seed);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int eval_vt_part_id(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObTaskExecutorCtx& task_exec_ctx,
|
||||
const uint64_t table_id);
|
||||
static bool is_oracle_supported_type(const common::ObObjType type);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartHash);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprFuncPartOldKey : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncPartOldKey(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncPartOldKey();
|
||||
|
||||
@ -30,13 +30,13 @@ class ObExprFuncPartOldKey : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int eval_part_old_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartOldKey);
|
||||
};
|
||||
|
||||
class ObExprFuncPartKey : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncPartKey(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncPartKey();
|
||||
|
||||
@ -47,7 +47,7 @@ class ObExprFuncPartKey : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_partition_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartKey);
|
||||
};
|
||||
@ -55,7 +55,7 @@ class ObExprFuncPartKey : public ObFuncExprOperator {
|
||||
// key partitioning function, third version.
|
||||
// solve partition row skew problem
|
||||
class ObExprFuncPartNewKey : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncPartNewKey(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncPartNewKey();
|
||||
|
||||
@ -66,7 +66,7 @@ class ObExprFuncPartNewKey : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_new_partition_key(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprFuncPartNewKey);
|
||||
};
|
||||
|
||||
@ -20,7 +20,7 @@ namespace sql {
|
||||
#define ROUND_MIN_SCALE -30
|
||||
#define ROUND_MAX_SCALE 30
|
||||
class ObExprFuncRound : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprFuncRound(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprFuncRound();
|
||||
virtual int calc_result_typeN(
|
||||
@ -29,7 +29,7 @@ class ObExprFuncRound : public ObFuncExprOperator {
|
||||
common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int calc_result1(common::ObObj& result, const common::ObObj& input, common::ObExprCtx& expr_ctx) const;
|
||||
int calc_result2(
|
||||
common::ObObj& result, const common::ObObj& input, const common::ObObj& param, common::ObExprCtx& expr_ctx) const;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprSleep : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprSleep(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprSleep();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& param, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -28,10 +28,10 @@ class ObExprSleep : public ObFuncExprOperator {
|
||||
static int eval_sleep(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res);
|
||||
virtual int cg_expr(ObExprCGCtx& ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const int64_t CHECK_INTERVAL_IN_US = 100 * 1000LL;
|
||||
static const int64_t SCALE_OF_SECOND = 9; // ns
|
||||
private:
|
||||
private:
|
||||
static int sleep(int64_t usec);
|
||||
static int get_usec(const common::number::ObNumber& nmb, int64_t& value, common::ObIAllocator& alloc);
|
||||
// disallow copy
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
// get_sys_var(name, scope)
|
||||
class ObExprGetSysVar : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
static const ObExprOperatorType op_type_;
|
||||
ObExprGetSysVar();
|
||||
explicit ObExprGetSysVar(common::ObIAllocator& alloc);
|
||||
@ -32,7 +32,7 @@ class ObExprGetSysVar : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_get_sys_val_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int calc_(common::ObObj& result, const common::ObString& var_name, const int64_t var_scope,
|
||||
ObSQLSessionInfo* session, ObExecContext* exec_ctx, common::ObIAllocator& alloc);
|
||||
static int get_session_var(common::ObObj& result, const common::ObString& var_name, common::ObIAllocator& alloc,
|
||||
@ -40,7 +40,7 @@ class ObExprGetSysVar : public ObFuncExprOperator {
|
||||
static int get_sys_var_disp_obj(common::ObIAllocator& allocator, const ObSQLSessionInfo& session,
|
||||
const common::ObString& var_name, common::ObObj& disp_obj);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGetSysVar);
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprGetUserVar : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprGetUserVar(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprGetUserVar();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -27,7 +27,7 @@ class ObExprGetUserVar : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& expr) const override;
|
||||
static int eval_get_user_var(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGetUserVar);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprGreaterEqual : public ObRelationalExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprGreaterEqual();
|
||||
explicit ObExprGreaterEqual(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprGreaterEqual(){};
|
||||
@ -32,7 +32,7 @@ class ObExprGreaterEqual : public ObRelationalExprOperator {
|
||||
return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGreaterEqual);
|
||||
};
|
||||
} // end namespace sql
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprGreaterThan : public ObRelationalExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprGreaterThan();
|
||||
explicit ObExprGreaterThan(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprGreaterThan(){};
|
||||
@ -34,7 +34,7 @@ class ObExprGreaterThan : public ObRelationalExprOperator {
|
||||
return ObRelationalExprOperator::cg_expr(expr_cg_ctx, raw_expr, rt_expr);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGreaterThan);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprBaseGreatest : public ObExprBaseLeastGreatest {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprBaseGreatest(common::ObIAllocator& alloc, int32_t param_num,
|
||||
ObExprOperatorType type = T_FUN_SYS_GREATEST, const char* name = N_GREATEST);
|
||||
virtual ~ObExprBaseGreatest();
|
||||
@ -32,41 +32,41 @@ class ObExprBaseGreatest : public ObExprBaseLeastGreatest {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_greatest(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprBaseGreatest);
|
||||
};
|
||||
|
||||
class ObExprGreatestMySQL : public ObExprBaseGreatest {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprGreatestMySQL(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprGreatestMySQL();
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGreatestMySQL);
|
||||
};
|
||||
|
||||
class ObExprGreatestMySQLInner : public ObExprBaseGreatest {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprGreatestMySQLInner(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprGreatestMySQLInner();
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprGreatestMySQLInner);
|
||||
};
|
||||
|
||||
class ObExprOracleGreatest : public ObExprBaseGreatest {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprOracleGreatest(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprOracleGreatest();
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprOracleGreatest);
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprHex : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprHex(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprHex();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -29,12 +29,12 @@ class ObExprHex : public ObStringExprOperator {
|
||||
|
||||
static int eval_hex(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// helper func
|
||||
static int get_uint64(const common::ObObj& obj, common::ObCastCtx& cast_ctx, uint64_t& out);
|
||||
static int number_uint64(const common::number::ObNumber& num_val, uint64_t& out);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprHex);
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprHextoraw : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprHextoraw(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprHextoraw();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -27,7 +27,7 @@ class ObExprHextoraw : public ObStringExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_hextoraw_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprHextoraw);
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprHostIP : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprHostIP(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprHostIP();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -26,7 +26,7 @@ class ObExprHostIP : public ObFuncExprOperator {
|
||||
static int eval_host_ip(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprHostIP);
|
||||
};
|
||||
} // namespace sql
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprIfNull : public ObFuncExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprIfNull(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprIfNull();
|
||||
virtual int calc_result_type2(
|
||||
@ -28,10 +28,10 @@ class ObExprIfNull : public ObFuncExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_ifnull_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprIfNull);
|
||||
|
||||
private:
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ struct HashMapMeta {
|
||||
*/
|
||||
template <class T>
|
||||
class Row {
|
||||
public:
|
||||
public:
|
||||
Row() : elems_(NULL)
|
||||
{}
|
||||
~Row()
|
||||
@ -66,12 +66,12 @@ class Row {
|
||||
}
|
||||
TO_STRING_KV(KP(elems_));
|
||||
|
||||
private:
|
||||
private:
|
||||
T* elems_;
|
||||
};
|
||||
template <class T>
|
||||
struct RowKey {
|
||||
public:
|
||||
public:
|
||||
RowKey() : row_(), meta_(NULL)
|
||||
{}
|
||||
~RowKey()
|
||||
@ -84,7 +84,7 @@ struct RowKey {
|
||||
|
||||
template <class T>
|
||||
class ObExprInHashMap {
|
||||
public:
|
||||
public:
|
||||
const static int HASH_CMP_TRUE = 0;
|
||||
const static int HASH_CMP_FALSE = -1;
|
||||
const static int HASH_CMP_UNKNOWN = 1;
|
||||
@ -124,14 +124,14 @@ class ObExprInHashMap {
|
||||
meta_.cmp_funcs_ = cmp_funcs;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
common::hash::ObHashMap<RowKey<T>, common::ObArray<Row<T>>, common::hash::NoPthreadDefendMode> map_;
|
||||
HashMapMeta meta_;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class ObExprInHashSet {
|
||||
public:
|
||||
public:
|
||||
ObExprInHashSet() : set_(), meta_()
|
||||
{}
|
||||
~ObExprInHashSet()
|
||||
@ -169,7 +169,7 @@ class ObExprInHashSet {
|
||||
meta_.cmp_funcs_ = cmp_funcs;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
common::hash::ObHashSet<RowKey<T>, common::hash::NoPthreadDefendMode> set_;
|
||||
HashMapMeta meta_;
|
||||
};
|
||||
@ -179,7 +179,7 @@ class ObSubQueryIterator;
|
||||
|
||||
class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
class ObExprInCtx : public ObExprOperatorCtx {
|
||||
public:
|
||||
public:
|
||||
ObExprInCtx()
|
||||
: ObExprOperatorCtx(),
|
||||
right_has_null(false),
|
||||
@ -217,7 +217,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
int init_hashset(int64_t param_num);
|
||||
int init_hashset_vecs(int64_t param_num, int64_t row_dimension, ObExecContext* exec_ctx);
|
||||
int init_static_engine_hashset(int64_t param_num);
|
||||
@ -287,7 +287,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
bool funcs_ptr_set;
|
||||
bool ctx_hash_null_;
|
||||
|
||||
private:
|
||||
private:
|
||||
common::ObObj** right_objs_;
|
||||
common::ObDatum** right_datums_;
|
||||
common::hash::ObHashSet<common::ObObj, common::hash::NoPthreadDefendMode> hashset_;
|
||||
@ -311,7 +311,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
ObExprInOrNotIn(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name);
|
||||
virtual ~ObExprInOrNotIn(){};
|
||||
virtual int calc_resultN(
|
||||
@ -332,7 +332,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
static int eval_in_with_row(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int eval_in_without_row(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int eval_in_with_row_fallback(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
@ -341,7 +341,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
static int eval_in_with_subquery(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int calc_for_row_static_engine(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, ObExpr** l_row);
|
||||
|
||||
public:
|
||||
public:
|
||||
inline void set_param_all_const(bool all_const);
|
||||
inline void set_param_all_same_type(bool all_same_type);
|
||||
inline void set_param_all_same_cs_type(bool all_same_cs_type);
|
||||
@ -349,7 +349,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
// for func visit_in_expr , when left param is subquery set true
|
||||
inline void set_param_is_subquery();
|
||||
// static bool nd_hash_;
|
||||
protected:
|
||||
protected:
|
||||
int calc(common::ObObj& result, const common::ObObj* objs, const common::ObIArray<ObExprCalcType>& cmp_types,
|
||||
int64_t param_num, common::ObCompareCtx& cmp_ctx, common::ObExprCtx& expr_ctx, common::ObCastCtx& cast_ctx) const;
|
||||
// like "select 1 from dual where (select 1, 2) in ((1,2), (3,4))"
|
||||
@ -384,7 +384,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
static int setup_row(ObExpr** expr, ObEvalCtx& ctx, const bool is_iter, const int64_t cmp_func_cnt,
|
||||
ObSubQueryIterator*& iter, ObExpr**& row);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
typedef uint32_t ObExprInParamFlag;
|
||||
static const uint32_t IN_PARAM_ALL_CONST = 1U << 0;
|
||||
static const uint32_t IN_PARAM_ALL_SAME_TYPE = 1U << 1;
|
||||
@ -396,20 +396,20 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
|
||||
};
|
||||
|
||||
class ObExprIn : public ObExprInOrNotIn {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprIn(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprIn(){};
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual void set_result(common::ObObj& result, bool is_exist, bool param_exist_null) const;
|
||||
};
|
||||
|
||||
class ObExprNotIn : public ObExprInOrNotIn {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprNotIn(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprNotIn(){};
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual void set_result(common::ObObj& result, bool is_exist, bool param_exist_null) const;
|
||||
};
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObExprInitcap : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprInitcap(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprInitcap();
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const;
|
||||
@ -28,7 +28,7 @@ class ObExprInitcap : public ObStringExprOperator {
|
||||
static int initcap_string(const common::ObString& text, const common::ObCollationType cs_type,
|
||||
common::ObIAllocator* allocator, common::ObString& res_str);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprInitcap);
|
||||
};
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprInnerTrim : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprInnerTrim(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprInnerTrim();
|
||||
virtual int calc_result_type3(ObExprResType& type, ObExprResType& trim_type, ObExprResType& trim_pattern,
|
||||
@ -28,7 +28,7 @@ class ObExprInnerTrim : public ObStringExprOperator {
|
||||
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprInnerTrim);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprInsert : public ObStringExprOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObExprInsert(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprInsert();
|
||||
virtual int calc_result(common::ObObj& result, const common::ObObj& text, const common::ObObj& start_pos,
|
||||
@ -36,7 +36,7 @@ class ObExprInsert : public ObStringExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
static int calc_expr_insert(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprInsert);
|
||||
};
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprInstr : public ObLocationExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprInstr();
|
||||
explicit ObExprInstr(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprInstr();
|
||||
@ -25,12 +25,12 @@ class ObExprInstr : public ObLocationExprOperator {
|
||||
virtual int cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
|
||||
static int calc_mysql_instr_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprInstr);
|
||||
};
|
||||
|
||||
class ObExprOracleInstr : public ObLocationExprOperator {
|
||||
public:
|
||||
public:
|
||||
ObExprOracleInstr();
|
||||
explicit ObExprOracleInstr(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprOracleInstr();
|
||||
@ -47,7 +47,7 @@ class ObExprOracleInstr : public ObLocationExprOperator {
|
||||
static int calc(common::ObObj& result, const common::ObObj& heystack, const common::ObObj& needle,
|
||||
const common::ObObj& position, const common::ObObj& occurrence, common::ObExprCtx& expr_ctx);
|
||||
|
||||
private:
|
||||
private:
|
||||
virtual int calc_result_type2(
|
||||
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprOracleInstr);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user