fix compile warnings
This commit is contained in:
@ -20,11 +20,15 @@ class ObExprAcos : public ObFuncExprOperator {
|
||||
public:
|
||||
explicit ObExprAcos(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprAcos();
|
||||
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:
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ namespace sql {
|
||||
class ObExprEqual : public ObRelationalExprOperator {
|
||||
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;
|
||||
virtual int calc_resultN(
|
||||
common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
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,16 +35,26 @@ 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;
|
||||
|
||||
private:
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
@ -21,11 +21,16 @@ class ObExprEstimateNdv : public ObFuncExprOperator {
|
||||
public:
|
||||
explicit ObExprEstimateNdv(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprEstimateNdv();
|
||||
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;
|
||||
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);
|
||||
|
||||
@ -20,8 +20,12 @@ class ObExprExists : public ObSubQueryRelationalExpr {
|
||||
explicit ObExprExists(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprExists();
|
||||
|
||||
virtual int calc_result_type1(ObExprResType& type, ObExprResType& type1, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& obj1, common::ObExprCtx& expr_ctx) const;
|
||||
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;
|
||||
|
||||
|
||||
@ -23,23 +23,33 @@ class ObExprExtract : public ObFuncExprOperator {
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprExtract);
|
||||
};
|
||||
|
||||
@ -21,10 +21,12 @@ class ObExprMySQLPort : public ObFuncExprOperator {
|
||||
public:
|
||||
explicit ObExprMySQLPort(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprMySQLPort();
|
||||
virtual int calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result0(common::ObObj& result, common::ObExprCtx& expr_ctx) const;
|
||||
static int eval_mysql_port(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;
|
||||
virtual int calc_result_type0(ObExprResType &type, common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result0(common::ObObj &result, common::ObExprCtx &expr_ctx) const override;
|
||||
static int eval_mysql_port(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:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprMySQLPort);
|
||||
|
||||
@ -860,15 +860,20 @@ class ObFuncExprOperator : public ObExprOperator {
|
||||
// In ObRelationalExprOperator, there are three concepts: res_type, cmp_type, calc_type
|
||||
// The first two are relative to the expression; the latter one is relative to the parameters of the expression.
|
||||
//
|
||||
class ObRelationalExprOperator : public ObExprOperator {
|
||||
public:
|
||||
virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos);
|
||||
|
||||
public:
|
||||
ObRelationalExprOperator(common::ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num,
|
||||
int32_t dimension = NOT_ROW_DIMENSION)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension), cmp_op_func2_(NULL)
|
||||
{}
|
||||
class ObRelationalExprOperator : public ObExprOperator
|
||||
{
|
||||
public:
|
||||
virtual int deserialize(const char *buf, const int64_t data_len, int64_t &pos) override;
|
||||
public:
|
||||
ObRelationalExprOperator(common::ObIAllocator &alloc,
|
||||
ObExprOperatorType type,
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
int32_t dimension = NOT_ROW_DIMENSION)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension),
|
||||
cmp_op_func2_(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~ObRelationalExprOperator()
|
||||
{}
|
||||
@ -931,8 +936,11 @@ class ObRelationalExprOperator : public ObExprOperator {
|
||||
common::ObCastCtx& cast_ctx, common::ObObjType cmp_type, common::ObCollationType cmp_cs_type);
|
||||
// determine the type used for comparison of the two types
|
||||
// binary comparison
|
||||
virtual int calc_result_type2(
|
||||
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const;
|
||||
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
|
||||
// deduce binary comparison result type and parameters types
|
||||
static int deduce_cmp_type(const ObExprOperator& expr, ObExprResType& type, ObExprResType& type1,
|
||||
@ -940,48 +948,73 @@ class ObRelationalExprOperator : public ObExprOperator {
|
||||
|
||||
// for between...and, not between...and etc.
|
||||
// @todo need refactor, ....yzf....Thu, 6 Aug 2015....16:00....
|
||||
virtual int calc_result_type3(ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprResType& type3,
|
||||
common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_calc_type3(ObExprResType& type1, ObExprResType& type2, ObExprResType& type3,
|
||||
common::ObExprTypeCtx& type_ctx, const common::ObObjType cmp_type) const;
|
||||
int get_cmp_result_type3(ObExprResType& type, bool& need_no_cast, const ObExprResType* types, const int64_t param_num,
|
||||
const sql::ObSQLSessionInfo& my_session);
|
||||
virtual int calc_result_type3(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
ObExprResType &type3,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_calc_type3(ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
ObExprResType &type3,
|
||||
common::ObExprTypeCtx &type_ctx,
|
||||
const common::ObObjType cmp_type) const;
|
||||
int get_cmp_result_type3(ObExprResType &type,
|
||||
bool &need_no_cast,
|
||||
const ObExprResType *types,
|
||||
const int64_t param_num,
|
||||
const sql::ObSQLSessionInfo &my_session);
|
||||
|
||||
// vector comparison, e.g. (a,b,c) > (1,2,3)
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result2(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
|
||||
common::ObExprCtx& expr_ctx, bool is_null_safe, common::ObCmpOp cmp_op) const;
|
||||
virtual int calc_resultN(common::ObObj& result, const common::ObObj* objs_array, int64_t param_num,
|
||||
common::ObExprCtx& expr_ctx, bool is_null_safe, common::ObCmpOp cmp_op) const;
|
||||
virtual int calc_result_typeN(ObExprResType &type,
|
||||
ObExprResType *types,
|
||||
int64_t param_num,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result2(common::ObObj &result, const common::ObObj &obj1,
|
||||
const common::ObObj &obj2,
|
||||
common::ObExprCtx &expr_ctx, bool is_null_safe,
|
||||
common::ObCmpOp cmp_op) const;
|
||||
virtual int calc_resultN(common::ObObj &result,
|
||||
const common::ObObj *objs_array,
|
||||
int64_t param_num,
|
||||
common::ObExprCtx &expr_ctx,
|
||||
bool is_null_safe,
|
||||
common::ObCmpOp cmp_op) const;
|
||||
|
||||
static int is_equivalent(
|
||||
const common::ObObjMeta& meta1, const common::ObObjMeta& meta2, const common::ObObjMeta& meta3, bool& result);
|
||||
int assign(const ObExprOperator& other);
|
||||
int set_cmp_func(const common::ObObjType type1, const common::ObObjType type2);
|
||||
common::obj_cmp_func get_cmp_fun() const
|
||||
{
|
||||
return cmp_op_func2_;
|
||||
}
|
||||
static int is_equivalent(const common::ObObjMeta &meta1,
|
||||
const common::ObObjMeta &meta2,
|
||||
const common::ObObjMeta &meta3,
|
||||
bool &result);
|
||||
int assign(const ObExprOperator &other) override;
|
||||
int set_cmp_func(const common::ObObjType type1,
|
||||
const common::ObObjType type2);
|
||||
common::obj_cmp_func get_cmp_fun() const { return cmp_op_func2_; }
|
||||
|
||||
// pure virtual but implemented, derived classes can use this implement.
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override = 0;
|
||||
// pure virtual but implemented, derived classes can use this implement.
|
||||
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override = 0;
|
||||
|
||||
static int cg_row_cmp_expr(const int row_dim, common::ObIAllocator& allocator, const ObRawExpr& raw_expr,
|
||||
const ObExprOperatorInputTypeArray& input_types, ObExpr& rt_expr);
|
||||
static int cg_datum_cmp_expr(
|
||||
const ObRawExpr& raw_expr, const ObExprOperatorInputTypeArray& input_types, ObExpr& rt_expr);
|
||||
static int cg_row_cmp_expr(const int row_dim, common::ObIAllocator &allocator,
|
||||
const ObRawExpr &raw_expr,
|
||||
const ObExprOperatorInputTypeArray &input_types,
|
||||
ObExpr &rt_expr);
|
||||
static int cg_datum_cmp_expr(const ObRawExpr &raw_expr,
|
||||
const ObExprOperatorInputTypeArray &input_types,
|
||||
ObExpr &rt_expr);
|
||||
|
||||
static int is_row_cmp(const ObRawExpr&, int& row_dim);
|
||||
static int row_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datm);
|
||||
static int is_row_cmp(const ObRawExpr&, int &row_dim);
|
||||
static int row_eval(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datm);
|
||||
|
||||
// row compare
|
||||
// CAUTION: null safe equal row compare is not included.
|
||||
static int row_cmp(
|
||||
const ObExpr& expr, ObDatum& expr_datum, ObExpr** l_row, ObEvalCtx& l_ctx, ObExpr** r_row, ObEvalCtx& r_ctx);
|
||||
// row compare
|
||||
// CAUTION: null safe equal row compare is not included.
|
||||
static int row_cmp(const ObExpr &expr, ObDatum &expr_datum,
|
||||
ObExpr **l_row, ObEvalCtx &l_ctx, ObExpr **r_row, ObEvalCtx &r_ctx);
|
||||
|
||||
OB_INLINE static int get_comparator_operands(const ObExpr& expr, ObEvalCtx& ctx, common::ObDatum*& left,
|
||||
common::ObDatum*& right, ObDatum& result, bool& is_finish)
|
||||
OB_INLINE static int get_comparator_operands(
|
||||
const ObExpr &expr,
|
||||
ObEvalCtx &ctx,
|
||||
common::ObDatum *&left, common::ObDatum *&right,
|
||||
ObDatum &result, bool &is_finish)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(expr.args_[0]->eval(ctx, left))) {
|
||||
@ -1166,30 +1199,41 @@ class ObSubQueryRelationalExpr : public ObExprOperator {
|
||||
{
|
||||
right_is_iter_ = is_iter;
|
||||
}
|
||||
virtual void reset()
|
||||
virtual void reset() override
|
||||
{
|
||||
subquery_key_ = T_WITH_NONE;
|
||||
left_is_iter_ = false;
|
||||
right_is_iter_ = false;
|
||||
}
|
||||
virtual int calc_result_type2(
|
||||
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const;
|
||||
virtual int calc_result_typeN(
|
||||
ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
|
||||
int calc_result2(
|
||||
common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2, common::ObExprCtx& expr_ctx) const;
|
||||
int calc_resultN(
|
||||
common::ObObj& result, const common::ObObj* param_array, int64_t param_num, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int call(common::ObObj* stack, int64_t& stack_size, common::ObExprCtx& expr_ctx) const;
|
||||
virtual int eval(
|
||||
common::ObExprCtx& expr_ctx, common::ObObj& val, common::ObObj* params, int64_t param_num) const override;
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
virtual int calc_result_typeN(ObExprResType &type,
|
||||
ObExprResType *types,
|
||||
int64_t param_num,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
int calc_result2(common::ObObj &result,
|
||||
const common::ObObj &obj1,
|
||||
const common::ObObj &obj2,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
int calc_resultN(common::ObObj &result,
|
||||
const common::ObObj *param_array,
|
||||
int64_t param_num,
|
||||
common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int call(common::ObObj *stack, int64_t &stack_size, common::ObExprCtx &expr_ctx) const override;
|
||||
virtual int eval(common::ObExprCtx &expr_ctx, common::ObObj &val,
|
||||
common::ObObj *params, int64_t param_num) const override;
|
||||
|
||||
static int subquery_cmp_eval(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int subquery_cmp_eval(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
|
||||
VIRTUAL_TO_STRING_KV(N_EXPR_TYPE, get_type_name(type_), N_REAL_PARAM_NUM, real_param_num_, N_RESULT_TYPE,
|
||||
result_type_, K_(subquery_key), K_(left_is_iter), K_(right_is_iter));
|
||||
|
||||
protected:
|
||||
VIRTUAL_TO_STRING_KV(N_EXPR_TYPE, get_type_name(type_),
|
||||
N_REAL_PARAM_NUM, real_param_num_,
|
||||
N_RESULT_TYPE, result_type_,
|
||||
K_(subquery_key),
|
||||
K_(left_is_iter),
|
||||
K_(right_is_iter));
|
||||
protected:
|
||||
// The result of processing the subquery is a vector. In this case, the result
|
||||
// of the subquery has at most one row of data, and multiple rows of data are not allowed.
|
||||
// According to the characteristics of the vector, the result of the subquery
|
||||
|
||||
@ -21,12 +21,17 @@ class ObExprQuote : public ObStringExprOperator {
|
||||
ObExprQuote();
|
||||
explicit ObExprQuote(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprQuote();
|
||||
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;
|
||||
static int calc_quote_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& res_datum);
|
||||
|
||||
private:
|
||||
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;
|
||||
static int calc_quote_expr(const ObExpr &expr, ObEvalCtx &ctx,
|
||||
ObDatum &res_datum);
|
||||
private:
|
||||
static const int16_t APPEND_LEN = 2;
|
||||
static const int16_t LEN_OF_NULL = 4;
|
||||
// quote string
|
||||
|
||||
@ -26,9 +26,11 @@ class ObExprSubQueryEqual : public ObSubQueryRelationalExpr {
|
||||
return ObSubQueryRelationalExpr::cg_expr(op_cg_ctx, raw_expr, rt_expr);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual int compare_single_row(const common::ObNewRow& left_row, const common::ObNewRow& right_row,
|
||||
common::ObExprCtx& expr_ctx, common::ObObj& result) const;
|
||||
private:
|
||||
virtual int compare_single_row(const common::ObNewRow &left_row,
|
||||
const common::ObNewRow &right_row,
|
||||
common::ObExprCtx &expr_ctx,
|
||||
common::ObObj &result) const override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprSubQueryEqual);
|
||||
|
||||
@ -395,10 +395,7 @@ struct ObExprOperatorFetcher : public ObSqlExpression {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
op_ = NULL;
|
||||
}
|
||||
void reset() override { op_ = NULL; }
|
||||
|
||||
const ObExprOperator* op_;
|
||||
};
|
||||
|
||||
@ -103,16 +103,14 @@ class ObDeterminateTaskTransmit : public ObDistributedTransmit {
|
||||
|
||||
typedef common::hash::ObHashMap<int64_t, int64_t, common::hash::NoPthreadDefendMode> Id2IdxMap;
|
||||
typedef common::hash::ObHashSet<ObTaskID> TaskIDSet;
|
||||
public:
|
||||
explicit ObDeterminateTaskTransmit(common::ObIAllocator &alloc);
|
||||
virtual ~ObDeterminateTaskTransmit() {}
|
||||
|
||||
public:
|
||||
explicit ObDeterminateTaskTransmit(common::ObIAllocator& alloc);
|
||||
virtual ~ObDeterminateTaskTransmit()
|
||||
{}
|
||||
|
||||
virtual int init_op_ctx(ObExecContext& exec_ctx) const override;
|
||||
virtual int inner_open(ObExecContext& exec_ctx) const override;
|
||||
virtual int inner_close(ObExecContext& ctx) const override;
|
||||
virtual OperatorOpenOrder get_operator_open_order(ObExecContext& ctx) const;
|
||||
virtual int init_op_ctx(ObExecContext &exec_ctx) const override;
|
||||
virtual int inner_open(ObExecContext &exec_ctx) const override;
|
||||
virtual int inner_close(ObExecContext &ctx) const override;
|
||||
virtual OperatorOpenOrder get_operator_open_order(ObExecContext &ctx) const override;
|
||||
typedef common::ObFixedArray<ObTaskInfo::ObRangeLocation, common::ObIAllocator> RangeLocations;
|
||||
typedef common::ObFixedArray<TaskIndex, common::ObIAllocator> Tasks;
|
||||
typedef common::ObFixedArray<common::ObFixedArray<common::ObNewRange, common::ObIAllocator>, common::ObIAllocator>
|
||||
|
||||
@ -124,7 +124,7 @@ class ObDistributedTransmit : public ObTransmit {
|
||||
explicit ObDistributedTransmit(common::ObIAllocator& alloc);
|
||||
virtual ~ObDistributedTransmit();
|
||||
|
||||
virtual int create_operator_input(ObExecContext& ctx) const;
|
||||
virtual int create_operator_input(ObExecContext& ctx) const override;
|
||||
inline void set_shuffle_func(ObSqlExpression* shuffle_func);
|
||||
int get_part_shuffle_key(
|
||||
const share::schema::ObTableSchema* table_schema, int64_t part_idx, ObShuffleKey& part_shuffle_key) const;
|
||||
@ -133,29 +133,36 @@ class ObDistributedTransmit : public ObTransmit {
|
||||
int get_shuffle_part_key(const share::schema::ObTableSchema* table_schema, int64_t part_idx, int64_t subpart_idx,
|
||||
common::ObPartitionKey& shuffle_part_key) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
int init_slice_infos(
|
||||
const share::schema::ObTableSchema& table_schema, common::ObIArray<ObSliceInfo>& slices_info) const;
|
||||
int get_slice_idx(ObExecContext& exec_ctx, const share::schema::ObTableSchema* table_schema,
|
||||
const common::ObNewRow* row, const ObSqlExpression& part_partition_func,
|
||||
const ObSqlExpression& subpart_partition_func, const ObIArray<ObTransmitRepartColumn>& repart_columns,
|
||||
const ObIArray<ObTransmitRepartColumn>& repart_sub_columns, int64_t slices_count, int64_t& slice_idx,
|
||||
bool& no_match_partiton) const;
|
||||
const share::schema::ObTableSchema &table_schema,
|
||||
common::ObIArray<ObSliceInfo> &slices_info) const;
|
||||
int get_slice_idx(
|
||||
ObExecContext &exec_ctx,
|
||||
const share::schema::ObTableSchema *table_schema,
|
||||
const common::ObNewRow *row,
|
||||
const ObSqlExpression &part_partition_func,
|
||||
const ObSqlExpression &subpart_partition_func,
|
||||
const ObIArray<ObTransmitRepartColumn> &repart_columns,
|
||||
const ObIArray<ObTransmitRepartColumn> &repart_sub_columns,
|
||||
int64_t slices_count,
|
||||
int64_t &slice_idx,
|
||||
bool &no_match_partiton) const;
|
||||
|
||||
protected:
|
||||
virtual int inner_open(ObExecContext& exec_ctx) const;
|
||||
protected:
|
||||
virtual int inner_open(ObExecContext &exec_ctx) const override;
|
||||
/**
|
||||
* @brief init operator context, will create a physical operator context (and a current row space)
|
||||
* @param ctx[in], execute context
|
||||
* @return if success, return OB_SUCCESS, otherwise, return errno
|
||||
*/
|
||||
virtual int init_op_ctx(ObExecContext& ctx) const;
|
||||
virtual int init_op_ctx(ObExecContext &ctx) const override;
|
||||
bool skip_empty_slice() const;
|
||||
int prepare_interm_result(ObIntermResultManager& interm_result_mgr, ObIntermResult*& interm_result) const;
|
||||
int get_next_row(ObExecContext& ctx, const ObNewRow*& row) const override;
|
||||
int inner_get_next_row(ObExecContext& ctx, const ObNewRow*& row) const;
|
||||
|
||||
private:
|
||||
int prepare_interm_result(ObIntermResultManager &interm_result_mgr,
|
||||
ObIntermResult *&interm_result) const;
|
||||
int get_next_row(ObExecContext &ctx, const ObNewRow *&row) const override;
|
||||
int inner_get_next_row(ObExecContext &ctx, const ObNewRow *&row) const override;
|
||||
private:
|
||||
const static int64_t NO_MATCH_PARTITION = -2;
|
||||
ObSqlExpression* shuffle_func_;
|
||||
|
||||
|
||||
@ -464,10 +464,9 @@ class RelExprPointerChecker : public RelExprCheckerBase {
|
||||
virtual ~RelExprPointerChecker()
|
||||
{}
|
||||
virtual int init(int64_t bucket_num = CHECKER_BUCKET_NUM) override;
|
||||
int add_expr(ObRawExpr*& expr);
|
||||
|
||||
private:
|
||||
common::ObIArray<ObRawExprPointer>& rel_array_;
|
||||
int add_expr(ObRawExpr *&expr) override;
|
||||
private:
|
||||
common::ObIArray<ObRawExprPointer> &rel_array_;
|
||||
common::hash::ObHashMap<uint64_t, uint64_t, common::hash::NoPthreadDefendMode> expr_id_map_;
|
||||
};
|
||||
|
||||
|
||||
@ -282,9 +282,13 @@ int ObShardingInfo::is_compatible_partition_key(const common::ObIArray<ObRawExpr
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObShardingInfo::check_if_match_partition_wise(ObLogPlan& log_plan, const EqualSets& equal_sets,
|
||||
const common::ObIArray<ObRawExpr*>& left_keys, const common::ObIArray<ObRawExpr*>& right_keys,
|
||||
const ObShardingInfo& left_sharding, const ObShardingInfo& right_sharding, bool& is_partition_wise)
|
||||
int ObShardingInfo::check_if_match_partition_wise(ObLogPlan &log_plan __attribute__((unused)),
|
||||
const EqualSets &equal_sets,
|
||||
const common::ObIArray<ObRawExpr*> &left_keys,
|
||||
const common::ObIArray<ObRawExpr*> &right_keys,
|
||||
const ObShardingInfo &left_sharding,
|
||||
const ObShardingInfo &right_sharding,
|
||||
bool &is_partition_wise)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
bool is_key_covered = false;
|
||||
@ -384,8 +388,10 @@ int ObShardingInfo::check_if_match_repart(const EqualSets& equal_sets, const ObI
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObShardingInfo::is_physically_equal_partitioned(ObLogPlan& log_plan, const ObShardingInfo& left_sharding,
|
||||
const ObShardingInfo& right_sharding, bool& is_physical_equal)
|
||||
int ObShardingInfo::is_physically_equal_partitioned(ObLogPlan &log_plan __attribute__((unused)),
|
||||
const ObShardingInfo &left_sharding,
|
||||
const ObShardingInfo &right_sharding,
|
||||
bool &is_physical_equal)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ret = is_physically_equal_partitioned(left_sharding, right_sharding, is_physical_equal);
|
||||
|
||||
@ -216,7 +216,9 @@ int parse_sql_stmt(ParseResult* parse_result)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void setup_token_pos_info(ParseNode* node, int off, int len)
|
||||
void setup_token_pos_info(ParseNode *node __attribute__((unused)),
|
||||
int off __attribute__((unused)),
|
||||
int len __attribute__((unused)))
|
||||
{
|
||||
#ifdef SQL_PARSER_COMPILATION
|
||||
node->token_off_ = off;
|
||||
@ -226,7 +228,10 @@ void setup_token_pos_info(ParseNode* node, int off, int len)
|
||||
#endif
|
||||
}
|
||||
|
||||
int setup_token_pos_info_and_dup_string(ParseNode* node, ParseResult* result, int start, int end)
|
||||
int setup_token_pos_info_and_dup_string(ParseNode *node __attribute__((unused)),
|
||||
ParseResult *result __attribute__((unused)),
|
||||
int start __attribute__((unused)),
|
||||
int end __attribute__((unused)))
|
||||
{
|
||||
int ret = OB_PARSER_SUCCESS;
|
||||
#ifdef SQL_PARSER_COMPILATION
|
||||
|
||||
@ -76425,9 +76425,9 @@ YY_BUFFER_STATE obsql_mysql_yy_scan_bytes (yyconst char * yybytes, int _yybyte
|
||||
#define YY_EXIT_FAILURE 2
|
||||
#endif
|
||||
|
||||
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
|
||||
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)))
|
||||
{
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
exit( YY_EXIT_FAILURE );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user