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

@ -16,51 +16,63 @@
#include "sql/engine/expr/ob_expr_operator.h"
#include "sql/engine/expr/ob_expr_result_type_util.h"
namespace oceanbase {
namespace sql {
namespace oceanbase
{
namespace sql
{
typedef int (*ob_get_cmp_type_func)(common::ObObjType& type, const common::ObObjType& type1,
const common::ObObjType& type2, const common::ObObjType& type3);
typedef int (*ob_get_cmp_type_func) (common::ObObjType &type,
const common::ObObjType &type1,
const common::ObObjType &type2,
const common::ObObjType &type3);
class ObExprArgCase : public ObExprOperator {
class ObExprArgCase : public ObExprOperator
{
public:
explicit ObExprArgCase(common::ObIAllocator& alloc);
explicit ObExprArgCase(common::ObIAllocator &alloc);
virtual ~ObExprArgCase();
virtual int assign(const ObExprOperator& other);
virtual int assign(const ObExprOperator &other);
virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos);
virtual int deserialize(const char *buf, const int64_t data_len, int64_t &pos);
virtual int calc_result_typeN(
ObExprResType& type, ObExprResType* types_stack, int64_t param_num, common::ObExprTypeCtx& type_ctx) const;
virtual int calc_resultN(
common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num, common::ObExprCtx& expr_ctx) const;
static int calc_with_cast(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num,
common::ObCompareCtx& cmp_ctx, common::ObCastCtx& cast_ctx, const ObExprResType& res_type,
const ob_get_cmp_type_func get_cmp_type_func);
static int calc_without_cast(common::ObObj& result, const common::ObObj* objs_stack, int64_t param_num,
common::ObCastCtx& cast_ctx, common::ObCompareCtx& cmp_ctx, const ObExprResType& res_type);
void set_need_cast(bool need_cast)
{
need_cast_ = need_cast;
}
virtual int calc_result_typeN(ObExprResType &type,
ObExprResType *types_stack,
int64_t param_num,
common::ObExprTypeCtx &type_ctx) const;
static int calc_with_cast(common::ObObj &result,
const common::ObObj *objs_stack,
int64_t param_num,
common::ObCompareCtx &cmp_ctx,
common::ObCastCtx &cast_ctx,
const ObExprResType &res_type,
const ob_get_cmp_type_func get_cmp_type_func);
static int calc_without_cast(common::ObObj &result,
const common::ObObj *objs_stack,
int64_t param_num,
common::ObCastCtx &cast_ctx,
common::ObCompareCtx &cmp_ctx,
const ObExprResType &res_type);
void set_need_cast(bool need_cast) {need_cast_ = need_cast;}
inline static int get_cmp_type(common::ObObjType& type, const common::ObObjType& type1,
const common::ObObjType& type2, const common::ObObjType& type3)
inline static int get_cmp_type(common::ObObjType &type,
const common::ObObjType &type1,
const common::ObObjType &type2,
const common::ObObjType &type3)
{
UNUSED(type3);
return ObExprResultTypeUtil::get_relational_cmp_type(type, type1, type2);
return ObExprResultTypeUtil::get_relational_cmp_type(type,type1,type2);
}
virtual int cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const;
virtual int cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const;
private:
// disallow copy
DISALLOW_COPY_AND_ASSIGN(ObExprArgCase);
private:
bool need_cast_;
};
} // namespace sql
} // namespace oceanbase
#endif // OCEANBASE_OB_SQL_EXPR_ARG_CASE_H_
}
}
#endif // OCEANBASE_OB_SQL_EXPR_ARG_CASE_H_