patch 4.0
This commit is contained in:
@ -14,8 +14,10 @@
|
||||
#define OCEANBASE_EXPR_OB_EXPR_REMOVE_CONST_H_
|
||||
|
||||
#include "sql/engine/expr/ob_expr_operator.h"
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
|
||||
//
|
||||
// remove_const() is added above const expr to resolve the const value overwrite problem
|
||||
@ -30,26 +32,28 @@ namespace sql {
|
||||
// remove_const(1), remove_const(2) will be overwrite when subquery is empty
|
||||
// instead of const value: 1, 2
|
||||
//
|
||||
// see: https://yuque.antfin-inc.com/ob/sql/expression_result_overwrite#eaa08cb4
|
||||
//
|
||||
class ObExprRemoveConst : public ObFuncExprOperator {
|
||||
class ObExprRemoveConst : public ObFuncExprOperator
|
||||
{
|
||||
public:
|
||||
explicit ObExprRemoveConst(common::ObIAllocator& alloc);
|
||||
virtual ~ObExprRemoveConst()
|
||||
{}
|
||||
explicit ObExprRemoveConst(common::ObIAllocator &alloc);
|
||||
virtual ~ObExprRemoveConst() {}
|
||||
|
||||
virtual int calc_result_type1(
|
||||
ObExprResType& type, ObExprResType& arg, common::ObExprTypeCtx& type_ctx) const override;
|
||||
virtual int calc_result_type1(ObExprResType &type,
|
||||
ObExprResType &arg,
|
||||
common::ObExprTypeCtx &type_ctx) const override;
|
||||
|
||||
virtual int calc_result1(common::ObObj& result, const common::ObObj& arg, common::ObExprCtx& expr_ctx) const override;
|
||||
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_remove_const(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum);
|
||||
static int eval_remove_const(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum);
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObExprRemoveConst);
|
||||
};
|
||||
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
#endif // OCEANBASE_EXPR_OB_EXPR_REMOVE_CONST_H_
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
#endif // OCEANBASE_EXPR_OB_EXPR_REMOVE_CONST_H_
|
||||
|
||||
Reference in New Issue
Block a user