patch 4.0
This commit is contained in:
@ -16,21 +16,23 @@
|
||||
#include "lib/string/ob_string.h"
|
||||
#include "sql/engine/expr/ob_expr_regexp_context.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
class ObExprRegexp : public ObFuncExprOperator {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
class ObExprRegexp : public ObFuncExprOperator
|
||||
{
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
explicit ObExprRegexp(common::ObIAllocator& alloc);
|
||||
explicit ObExprRegexp(common::ObIAllocator &alloc);
|
||||
virtual ~ObExprRegexp();
|
||||
|
||||
virtual int assign(const ObExprOperator& other) override;
|
||||
virtual int assign(const ObExprOperator &other);
|
||||
|
||||
virtual int calc_result_type2(
|
||||
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int calc_result2(common::ObObj& result, const common::ObObj& obj, const common::ObObj& pattern,
|
||||
common::ObExprCtx& expr_ctx) const override;
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
ObExprResType &type1,
|
||||
ObExprResType &type2,
|
||||
common::ObExprTypeCtx &type_ctx) const;
|
||||
virtual inline void reset()
|
||||
{
|
||||
regexp_idx_ = common::OB_COMPACT_INVALID_INDEX;
|
||||
@ -39,44 +41,28 @@ public:
|
||||
ObFuncExprOperator::reset();
|
||||
}
|
||||
|
||||
inline int16_t get_regexp_idx() const
|
||||
{
|
||||
return regexp_idx_;
|
||||
}
|
||||
inline void set_regexp_idx(int16_t regexp_idx)
|
||||
{
|
||||
regexp_idx_ = regexp_idx;
|
||||
}
|
||||
inline void set_pattern_is_const(bool pattern_is_const)
|
||||
{
|
||||
pattern_is_const_ = pattern_is_const;
|
||||
}
|
||||
inline void set_value_is_const(bool value_is_const)
|
||||
{
|
||||
value_is_const_ = value_is_const;
|
||||
}
|
||||
inline int16_t get_regexp_idx() const { return regexp_idx_; }
|
||||
inline void set_regexp_idx(int16_t regexp_idx) { regexp_idx_ = regexp_idx; }
|
||||
inline void set_pattern_is_const(bool pattern_is_const) { pattern_is_const_ = pattern_is_const; }
|
||||
inline void set_value_is_const(bool value_is_const) { value_is_const_ = value_is_const; }
|
||||
|
||||
virtual bool need_rt_ctx() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
|
||||
|
||||
static int eval_regexp(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
virtual bool need_rt_ctx() const override { return true; }
|
||||
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const override;
|
||||
|
||||
static int eval_regexp(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
private:
|
||||
inline int need_fast_calc(common::ObExprCtx& expr_ctx, bool& result) const;
|
||||
|
||||
inline int need_fast_calc(common::ObExprCtx &expr_ctx, bool &result) const;
|
||||
private:
|
||||
int16_t regexp_idx_; // idx of posix_regexp_list_ in plan ctx, for regexp operator
|
||||
int16_t regexp_idx_; // idx of posix_regexp_list_ in plan ctx, for regexp operator
|
||||
bool pattern_is_const_;
|
||||
bool value_is_const_;
|
||||
|
||||
private:
|
||||
// disallow copy
|
||||
ObExprRegexp(const ObExprRegexp& other);
|
||||
ObExprRegexp& operator=(const ObExprRegexp& ohter);
|
||||
ObExprRegexp(const ObExprRegexp &other);
|
||||
ObExprRegexp &operator=(const ObExprRegexp &ohter);
|
||||
};
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
#endif /* OCEANBASE_SQL_ENGINE_EXPR_OB_EXPR_REGEXP_ */
|
||||
|
||||
Reference in New Issue
Block a user