提交 33c8a8dd 编写于 作者: O obdev 提交者: wangzelin.wzl

fix expr tmp result allocator sanity check core

上级 8e5fcb68
...@@ -40,7 +40,7 @@ ObEvalCtx::ObEvalCtx(ObExecContext &exec_ctx) ...@@ -40,7 +40,7 @@ ObEvalCtx::ObEvalCtx(ObExecContext &exec_ctx)
exec_ctx_(exec_ctx), exec_ctx_(exec_ctx),
tmp_alloc_(exec_ctx.get_eval_tmp_allocator()), tmp_alloc_(exec_ctx.get_eval_tmp_allocator()),
datum_caster_(NULL), datum_caster_(NULL),
tmp_alloc_used_(false), tmp_alloc_used_(exec_ctx.get_tmp_alloc_used()),
batch_idx_(0), batch_idx_(0),
batch_size_(0), batch_size_(0),
expr_res_alloc_(exec_ctx.get_eval_res_allocator()) expr_res_alloc_(exec_ctx.get_eval_res_allocator())
......
...@@ -255,7 +255,7 @@ public: ...@@ -255,7 +255,7 @@ public:
// Can not use allocator for expression result. (ObExpr::get_str_res_mem() is used for result). // Can not use allocator for expression result. (ObExpr::get_str_res_mem() is used for result).
common::ObArenaAllocator &tmp_alloc_; common::ObArenaAllocator &tmp_alloc_;
ObDatumCaster *datum_caster_; ObDatumCaster *datum_caster_;
bool tmp_alloc_used_; bool &tmp_alloc_used_;
private: private:
int64_t batch_idx_; int64_t batch_idx_;
int64_t batch_size_; int64_t batch_size_;
......
...@@ -121,7 +121,8 @@ ObExecContext::ObExecContext(ObIAllocator &allocator) ...@@ -121,7 +121,8 @@ ObExecContext::ObExecContext(ObIAllocator &allocator)
parent_ctx_(nullptr), parent_ctx_(nullptr),
nested_level_(0), nested_level_(0),
is_ps_prepare_stage_(false), is_ps_prepare_stage_(false),
register_op_id_(OB_INVALID_ID) register_op_id_(OB_INVALID_ID),
tmp_alloc_used_(false)
{ {
} }
...@@ -294,6 +295,7 @@ void ObExecContext::destroy_eval_allocator() ...@@ -294,6 +295,7 @@ void ObExecContext::destroy_eval_allocator()
{ {
eval_res_allocator_.reset(); eval_res_allocator_.reset();
eval_tmp_allocator_.reset(); eval_tmp_allocator_.reset();
tmp_alloc_used_ = false;
} }
int ObExecContext::get_temp_expr_eval_ctx(const ObTempExpr &temp_expr, int ObExecContext::get_temp_expr_eval_ctx(const ObTempExpr &temp_expr,
......
...@@ -286,6 +286,7 @@ public: ...@@ -286,6 +286,7 @@ public:
bool has_non_trivial_expr_op_ctx() const { return has_non_trivial_expr_op_ctx_; } bool has_non_trivial_expr_op_ctx() const { return has_non_trivial_expr_op_ctx_; }
void set_non_trivial_expr_op_ctx(bool v) { has_non_trivial_expr_op_ctx_ = v; } void set_non_trivial_expr_op_ctx(bool v) { has_non_trivial_expr_op_ctx_ = v; }
inline bool &get_tmp_alloc_used() { return tmp_alloc_used_; }
VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE; VIRTUAL_NEED_SERIALIZE_AND_DESERIALIZE;
protected: protected:
...@@ -613,6 +614,8 @@ protected: ...@@ -613,6 +614,8 @@ protected:
bool is_ps_prepare_stage_; bool is_ps_prepare_stage_;
// for sql plan monitor // for sql plan monitor
int64_t register_op_id_; int64_t register_op_id_;
// indicate if eval_tmp_allocator_ is used
bool tmp_alloc_used_;
// ------------------- // -------------------
private: private:
DISALLOW_COPY_AND_ASSIGN(ObExecContext); DISALLOW_COPY_AND_ASSIGN(ObExecContext);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册