[to #45941432] sql in mysql routine can not access cursor variable
This commit is contained in:
		@ -4522,7 +4522,8 @@ int lookup_pl_symbol(const void *pl_ns, const char *symbol, size_t len, int64_t
 | 
				
			|||||||
   const oceanbase::pl::ObPLBlockNS *ns = static_cast<const oceanbase::pl::ObPLBlockNS *>(pl_ns);
 | 
					   const oceanbase::pl::ObPLBlockNS *ns = static_cast<const oceanbase::pl::ObPLBlockNS *>(pl_ns);
 | 
				
			||||||
   if (OB_FAIL(ns->resolve_symbol(var_name, type, pl_data_type, parent_id, var_index))) {
 | 
					   if (OB_FAIL(ns->resolve_symbol(var_name, type, pl_data_type, parent_id, var_index))) {
 | 
				
			||||||
     LOG_WARN("failed to get var index", K(var_name), K(ret));
 | 
					     LOG_WARN("failed to get var index", K(var_name), K(ret));
 | 
				
			||||||
   } else if (oceanbase::pl::ObPLExternalNS::LOCAL_VAR == type) {
 | 
					   } else if (oceanbase::pl::ObPLExternalNS::LOCAL_VAR == type
 | 
				
			||||||
 | 
					              && !pl_data_type.is_cursor_type()) { // mysql can not access explicit cursor in sql/expression
 | 
				
			||||||
     *idx = var_index;
 | 
					     *idx = var_index;
 | 
				
			||||||
   } else { /*do nothing*/ }
 | 
					   } else { /*do nothing*/ }
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 | 
				
			|||||||
@ -772,10 +772,17 @@ int ObResolverUtils::check_type_match(const pl::ObPLResolveCtx &resolve_ctx,
 | 
				
			|||||||
        || ObExtendTC == ob_obj_type_class(dst_type)) {
 | 
					        || ObExtendTC == ob_obj_type_class(dst_type)) {
 | 
				
			||||||
      ret = OB_ERR_INVALID_TYPE_FOR_OP;
 | 
					      ret = OB_ERR_INVALID_TYPE_FOR_OP;
 | 
				
			||||||
      LOG_WARN("argument count not match", K(ret), K(src_type), K(dst_type));
 | 
					      LOG_WARN("argument count not match", K(ret), K(src_type), K(dst_type));
 | 
				
			||||||
    } else {
 | 
					    } else { // 检查普通类型之间是否可以互转
 | 
				
			||||||
      // 检查普通类型之间是否可以互转
 | 
					      if (lib::is_oracle_mode()) {
 | 
				
			||||||
        OZ (ObObjCaster::can_cast_in_oracle_mode(dst_type,
 | 
					        OZ (ObObjCaster::can_cast_in_oracle_mode(dst_type,
 | 
				
			||||||
          dst_pl_type.get_meta_type()->get_collation_type(), src_type, src_coll_type));
 | 
					          dst_pl_type.get_meta_type()->get_collation_type(), src_type, src_coll_type));
 | 
				
			||||||
 | 
					      } else if (!cast_supported(
 | 
				
			||||||
 | 
					        src_type, src_coll_type, dst_type, dst_pl_type.get_meta_type()->get_collation_type())) {
 | 
				
			||||||
 | 
					        ret = OB_ERR_INVALID_TYPE_FOR_OP;
 | 
				
			||||||
 | 
					        LOG_WARN("inconsistent datatypes",
 | 
				
			||||||
 | 
					          K(ret), K(src_type), K(src_coll_type),
 | 
				
			||||||
 | 
					          K(dst_type), K(dst_pl_type.get_meta_type()->get_collation_type()));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    bool is_numric_type = (IS_NUMRIC_TYPE(src_type) && IS_NUMRIC_TYPE(dst_type));
 | 
					    bool is_numric_type = (IS_NUMRIC_TYPE(src_type) && IS_NUMRIC_TYPE(dst_type));
 | 
				
			||||||
    OX (match_info = ObRoutineMatchInfo::MatchInfo(
 | 
					    OX (match_info = ObRoutineMatchInfo::MatchInfo(
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user