patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -15,38 +15,56 @@
#include "sql/engine/expr/ob_expr_operator.h"
namespace oceanbase {
namespace sql {
class ObExprConcat : public ObStringExprOperator {
namespace oceanbase
{
namespace sql
{
class ObExprConcat : public ObStringExprOperator
{
public:
explicit ObExprConcat(common::ObIAllocator& alloc);
explicit ObExprConcat(common::ObIAllocator &alloc);
virtual ~ObExprConcat();
virtual int calc_resultN(
common::ObObj& result, const common::ObObj* objs, int64_t param_num, common::ObExprCtx& expr_ctx) const override;
virtual int calc_result_typeN(
ObExprResType& type, ObExprResType* types, int64_t param_num, common::ObExprTypeCtx& type_ctx) const override;
static int calc(common::ObObj& result, const common::ObObj& obj1, const common::ObObj& obj2,
common::ObIAllocator* allocator, const common::ObObjType result_type, bool is_oracle_mode);
virtual int calc_result_typeN(ObExprResType &type,
ObExprResType *types,
int64_t param_num,
common::ObExprTypeCtx &type_ctx) const;
static int calc(common::ObObj &result,
const common::ObObj &obj1,
const common::ObObj &obj2,
common::ObIAllocator *allocator,
const common::ObObjType result_type,
bool is_oracle_mode,
const int64_t max_result_len);
// Check result length with %max_result_len (if %max_result_len greater than zero)
// or max length of varchar.
// %result type is set to varchar.
static int calc(common::ObObj& result, const common::ObString obj1, const common::ObString obj2,
common::ObIAllocator* allocator, bool is_oracle_mode = false, const int64_t max_result_len = 0);
static int calc(common::ObObj &result,
const common::ObString obj1,
const common::ObString obj2,
common::ObIAllocator *allocator,
bool is_oracle_mode,
const int64_t max_result_len);
// Check result length with OB_MAX_PACKET_LENGTH.
// %result type is set to ObLongTextType
static int calc(common::ObObj& result, const char* obj1_ptr, const int32_t this_len, const char* obj2_ptr,
const int32_t other_len, common::ObIAllocator* allocator);
static int calc(common::ObObj &result,
const char *obj1_ptr,
const int32_t this_len,
const char *obj2_ptr,
const int32_t other_len,
common::ObIAllocator *allocator);
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const override;
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const override;
static int eval_concat(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
static int eval_concat(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
private:
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObExprConcat);
};
} // namespace sql
} // namespace oceanbase
}
}
#endif /* _OB_SQL_EXPR_CONCAT_H_ */