[scn] fix 4377 caused by miss one line code when refresh
This commit is contained in:
		@ -1260,28 +1260,6 @@ int ObStaticEngineExprCG::alloc_so_check_exprs(const ObIArray<ObRawExpr *> &raw_
 | 
			
		||||
    if (OB_SUCC(ret) && stack_check_expr_cnt > 0) {
 | 
			
		||||
      LOG_TRACE("stack check expr needed",
 | 
			
		||||
                K(exprs.count()), K(stack_check_expr_cnt), K(max_call_depth));
 | 
			
		||||
      ObExpr *ori_base = exprs.get_data();
 | 
			
		||||
      OZ(exprs.reserve(exprs.count() + stack_check_expr_cnt));
 | 
			
		||||
      ObExpr *base = exprs.get_data();
 | 
			
		||||
      // relocate expr ptr
 | 
			
		||||
      if (OB_SUCC(ret) && ori_base != base) {
 | 
			
		||||
        const int64_t offset = reinterpret_cast<char *>(base) - reinterpret_cast<char *>(ori_base);
 | 
			
		||||
        FOREACH_CNT(e, raw_exprs) {
 | 
			
		||||
          (*e)->set_rt_expr(reinterpret_cast<ObExpr *>(
 | 
			
		||||
                  reinterpret_cast<char *>(get_rt_expr(**e)) + offset));
 | 
			
		||||
        }
 | 
			
		||||
        FOREACH_CNT(e, exprs_call_depth) {
 | 
			
		||||
          *reinterpret_cast<char **>(&e->expr_) += offset;
 | 
			
		||||
        }
 | 
			
		||||
        FOREACH_CNT(e, exprs) {
 | 
			
		||||
          for (int64_t i = 0; i < e->parent_cnt_; i++) {
 | 
			
		||||
            *reinterpret_cast<char **>(&e->parents_[i]) += offset;
 | 
			
		||||
          }
 | 
			
		||||
          for (int64_t i = 0; i < e->arg_cnt_; i++) {
 | 
			
		||||
            *reinterpret_cast<char **>(&e->args_[i]) += offset;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      FOREACH_CNT_X(ecd, exprs_call_depth, OB_SUCC(ret)) {
 | 
			
		||||
        if (ecd->need_stack_check_) {
 | 
			
		||||
@ -1295,7 +1273,7 @@ int ObStaticEngineExprCG::alloc_so_check_exprs(const ObIArray<ObRawExpr *> &raw_
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          if (OB_SUCC(ret) && e->parent_cnt_ > 0) {
 | 
			
		||||
            OZ(add_so_check_expr_above(exprs, e));
 | 
			
		||||
            e->need_stack_check_ = true;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      } // END FOREACH_CNT_X
 | 
			
		||||
@ -1304,52 +1282,6 @@ int ObStaticEngineExprCG::alloc_so_check_exprs(const ObIArray<ObRawExpr *> &raw_
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ObStaticEngineExprCG::add_so_check_expr_above(ObIArray<ObExpr> &exprs, ObExpr *e)
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
  ObExpr *base = exprs.get_data();
 | 
			
		||||
  CK(NULL != e);
 | 
			
		||||
  CK(e->parent_cnt_ > 0 && e->arg_cnt_ > 0);
 | 
			
		||||
  OZ(exprs.push_back(*e));
 | 
			
		||||
  CK(base == exprs.get_data());
 | 
			
		||||
  if (OB_SUCC(ret)) {
 | 
			
		||||
    // stack overflow check expr point to the same ObDatum of child.
 | 
			
		||||
    ObExpr *so = &exprs.at(exprs.count() - 1);
 | 
			
		||||
    so->type_ = T_OP_STACK_OVERFLOW_CHECK;
 | 
			
		||||
    so->extra_ = 0;
 | 
			
		||||
    so->inner_functions_ = 0;
 | 
			
		||||
    so->inner_func_cnt_ = 0;
 | 
			
		||||
    ObExpr **parents = static_cast<ObExpr **>(allocator_.alloc(sizeof(ObExpr *) * 2));
 | 
			
		||||
    if (NULL == parents) {
 | 
			
		||||
      ret = OB_ALLOCATE_MEMORY_FAILED;
 | 
			
		||||
      LOG_WARN("allocate memory failed", K(ret));
 | 
			
		||||
    } else {
 | 
			
		||||
      ObExpr **args = parents + 1;
 | 
			
		||||
 | 
			
		||||
      parents[0] = so;
 | 
			
		||||
      args[0] = e;
 | 
			
		||||
 | 
			
		||||
      e->parents_ = parents;
 | 
			
		||||
      e->parent_cnt_ = 1;
 | 
			
		||||
      so->args_ = args;
 | 
			
		||||
      so->arg_cnt_ = 1;
 | 
			
		||||
 | 
			
		||||
      for (int64_t i = 0; i < so->parent_cnt_; i++) {
 | 
			
		||||
        ObExpr *p = so->parents_[i];
 | 
			
		||||
        for (int64_t j = 0; j < p->arg_cnt_; j++) {
 | 
			
		||||
          if (p->args_[j] == e) {
 | 
			
		||||
            p->args_[j] = so;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      so->eval_func_ = ObExprUtil::eval_stack_overflow_check;
 | 
			
		||||
      so->eval_batch_func_ = ObExprUtil::eval_batch_stack_overflow_check;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ObStaticEngineExprCG::calc_exprs_res_buf_len(const ObIArray<ObRawExpr *> &raw_exprs)
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
 | 
			
		||||
@ -196,9 +196,6 @@ private:
 | 
			
		||||
  // alloc stack overflow check exprs.
 | 
			
		||||
  int alloc_so_check_exprs(const common::ObIArray<ObRawExpr *> &raw_exprs,
 | 
			
		||||
                           ObExprFrameInfo &expr_info);
 | 
			
		||||
  // add stack overflow check expr above %e
 | 
			
		||||
  int add_so_check_expr_above(common::ObIArray<ObExpr> &exprs,
 | 
			
		||||
                              ObExpr *e);
 | 
			
		||||
 | 
			
		||||
  // calculate res_buf_len_ for exprs' datums
 | 
			
		||||
  int calc_exprs_res_buf_len(const common::ObIArray<ObRawExpr *> &raw_exprs);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user