[CP] [CP] fix: fix the core induced by NLJ batch rescan not reset the ptr of ObDatum
This commit is contained in:
		@ -98,6 +98,7 @@ int ObDASGroupScanOp::open_op()
 | 
			
		||||
  iter_.init_group_range(cur_group_idx_, group_size_);
 | 
			
		||||
  if (OB_FAIL(iter_.init_row_store(scan_ctdef_->result_output_,
 | 
			
		||||
                                   *scan_rtdef_->eval_ctx_,
 | 
			
		||||
                                   scan_ctdef_->pd_expr_spec_.access_exprs_,
 | 
			
		||||
                                   scan_rtdef_->stmt_allocator_,
 | 
			
		||||
                                   max_size,
 | 
			
		||||
                                   scan_ctdef_->group_id_expr_,
 | 
			
		||||
@ -241,6 +242,7 @@ int ObDASGroupScanOp::decode_task_result(ObIDASTaskResult *task_result)
 | 
			
		||||
      iter_.init_group_range(cur_group_idx_, group_size_);
 | 
			
		||||
      if (OB_FAIL(iter_.init_row_store(scan_ctdef_->result_output_,
 | 
			
		||||
                                       *scan_rtdef_->eval_ctx_,
 | 
			
		||||
                                       scan_ctdef_->pd_expr_spec_.access_exprs_,
 | 
			
		||||
                                       scan_rtdef_->stmt_allocator_,
 | 
			
		||||
                                       max_size,
 | 
			
		||||
                                       scan_ctdef_->group_id_expr_,
 | 
			
		||||
@ -296,6 +298,7 @@ int ObGroupLookupOp::init_group_scan_iter(int64_t cur_group_idx,
 | 
			
		||||
  group_iter_.init_group_range(cur_group_idx, group_size);
 | 
			
		||||
  OZ(group_iter_.init_row_store(lookup_ctdef_->result_output_,
 | 
			
		||||
                                *lookup_rtdef_->eval_ctx_,
 | 
			
		||||
                                lookup_ctdef_->pd_expr_spec_.access_exprs_,
 | 
			
		||||
                                lookup_rtdef_->stmt_allocator_,
 | 
			
		||||
                                max_row_store_size,
 | 
			
		||||
                                group_id_expr,
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,7 @@ namespace sql
 | 
			
		||||
{
 | 
			
		||||
int ObGroupResultRows::init(const common::ObIArray<ObExpr *> &exprs,
 | 
			
		||||
                            ObEvalCtx &eval_ctx,
 | 
			
		||||
                            const ExprFixedArray &access_exprs,
 | 
			
		||||
                            ObIAllocator &das_op_allocator,
 | 
			
		||||
                            int64_t max_size,
 | 
			
		||||
                            ObExpr *group_id_expr,
 | 
			
		||||
@ -50,6 +51,7 @@ int ObGroupResultRows::init(const common::ObIArray<ObExpr *> &exprs,
 | 
			
		||||
      }
 | 
			
		||||
      inited_ = true;
 | 
			
		||||
      exprs_ = &exprs;
 | 
			
		||||
      access_exprs_ = &access_exprs;
 | 
			
		||||
      eval_ctx_ = &eval_ctx;
 | 
			
		||||
      max_size_ = max_size;
 | 
			
		||||
      group_id_expr_pos_ = OB_INVALID_INDEX;
 | 
			
		||||
@ -349,10 +351,12 @@ int ObGroupScanIter::get_next_rows(int64_t &count, int64_t capacity)
 | 
			
		||||
 | 
			
		||||
void ObGroupScanIter::reset_expr_datum_ptr()
 | 
			
		||||
{
 | 
			
		||||
  FOREACH_CNT(e, *row_store_.exprs_) {
 | 
			
		||||
    (*e)->locate_datums_for_update(*row_store_.eval_ctx_, row_store_.max_size_);
 | 
			
		||||
    ObEvalInfo &info = (*e)->get_eval_info(*row_store_.eval_ctx_);
 | 
			
		||||
    info.point_to_frame_ = true;
 | 
			
		||||
  if (OB_NOT_NULL(row_store_.access_exprs_)) {
 | 
			
		||||
    FOREACH_CNT(e, *row_store_.access_exprs_) {
 | 
			
		||||
      (*e)->locate_datums_for_update(*row_store_.eval_ctx_, row_store_.max_size_);
 | 
			
		||||
      ObEvalInfo &info = (*e)->get_eval_info(*row_store_.eval_ctx_);
 | 
			
		||||
      info.point_to_frame_ = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@ class ObGroupResultRows
 | 
			
		||||
public:
 | 
			
		||||
  ObGroupResultRows() : inited_(false), exprs_(NULL), eval_ctx_(NULL),
 | 
			
		||||
                        saved_size_(0), max_size_(1), start_pos_(0), group_id_expr_pos_(0),
 | 
			
		||||
                        rows_(NULL), need_check_output_datum_(false),reuse_alloc_(nullptr)
 | 
			
		||||
                        rows_(NULL), need_check_output_datum_(false),reuse_alloc_(nullptr),access_exprs_(nullptr)
 | 
			
		||||
  {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -31,6 +31,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  int init(const common::ObIArray<ObExpr *> &exprs,
 | 
			
		||||
           ObEvalCtx &eval_ctx,
 | 
			
		||||
           const ExprFixedArray &access_exprs,
 | 
			
		||||
           common::ObIAllocator &das_op_allocator,
 | 
			
		||||
           int64_t max_size,
 | 
			
		||||
           ObExpr *group_id_expr,
 | 
			
		||||
@ -57,6 +58,7 @@ public:
 | 
			
		||||
      reuse_alloc_->~ObArenaAllocator();
 | 
			
		||||
      reuse_alloc_ = nullptr;
 | 
			
		||||
    }
 | 
			
		||||
    access_exprs_ = nullptr;
 | 
			
		||||
  }
 | 
			
		||||
  TO_STRING_KV(K_(saved_size),
 | 
			
		||||
               K_(start_pos),
 | 
			
		||||
@ -86,6 +88,7 @@ public:
 | 
			
		||||
  //be move from das into Table scan op, every thing will be easy.
 | 
			
		||||
  common::ObArenaAllocator *reuse_alloc_;
 | 
			
		||||
  char reuse_alloc_buf_[sizeof(common::ObArenaAllocator)];
 | 
			
		||||
  const ExprFixedArray *access_exprs_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class ObGroupScanIter : public ObNewRowIterator
 | 
			
		||||
@ -116,6 +119,7 @@ public:
 | 
			
		||||
  ObExpr *get_group_id_expr() { return group_id_expr_; }
 | 
			
		||||
  int init_row_store(const common::ObIArray<ObExpr *> &exprs,
 | 
			
		||||
                     ObEvalCtx &eval_ctx,
 | 
			
		||||
                     const ExprFixedArray &access_exprs,
 | 
			
		||||
                     common::ObIAllocator &das_op_allocator,
 | 
			
		||||
                     int64_t max_size,
 | 
			
		||||
                     ObExpr *group_id_expr,
 | 
			
		||||
@ -127,6 +131,7 @@ public:
 | 
			
		||||
    iter_ = iter;
 | 
			
		||||
    return row_store_.init(exprs,
 | 
			
		||||
                           eval_ctx,
 | 
			
		||||
                           access_exprs,
 | 
			
		||||
                           das_op_allocator,
 | 
			
		||||
                           max_size,
 | 
			
		||||
                           group_id_expr,
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user