diff --git a/src/pl/ob_pl_package_manager.cpp b/src/pl/ob_pl_package_manager.cpp index 6ba0cf6b88..674c4430d7 100644 --- a/src/pl/ob_pl_package_manager.cpp +++ b/src/pl/ob_pl_package_manager.cpp @@ -439,8 +439,11 @@ int ObPLPackageManager::get_package_var(const ObPLResolveCtx &resolve_ctx, uint6 return ret; } -int ObPLPackageManager::get_package_type(const ObPLResolveCtx &resolve_ctx, uint64_t package_id, - const ObString &type_name, const ObUserDefinedType *&user_type) +int ObPLPackageManager::get_package_type(const ObPLResolveCtx &resolve_ctx, + uint64_t package_id, + const ObString &type_name, + const ObUserDefinedType *&user_type, + bool log_user_error) { int ret = OB_SUCCESS; user_type = NULL; @@ -461,7 +464,9 @@ int ObPLPackageManager::get_package_type(const ObPLResolveCtx &resolve_ctx, uint } else if (OB_ISNULL(user_type)) { ret = OB_ERR_SP_UNDECLARED_TYPE; LOG_WARN("package type not found", K(package_id), K(type_name), K(ret)); - LOG_USER_ERROR(OB_ERR_SP_UNDECLARED_TYPE, type_name.length(), type_name.ptr()); + if (log_user_error) { + LOG_USER_ERROR(OB_ERR_SP_UNDECLARED_TYPE, type_name.length(), type_name.ptr()); + } else {} } else {} } } diff --git a/src/pl/ob_pl_package_manager.h b/src/pl/ob_pl_package_manager.h index 1cc12e3a08..fcdf45632a 100644 --- a/src/pl/ob_pl_package_manager.h +++ b/src/pl/ob_pl_package_manager.h @@ -77,8 +77,11 @@ public: int64_t var_idx, const ObPLVar *&var); - int get_package_type(const ObPLResolveCtx &resolve_ctx, uint64_t package_id, - const common::ObString &type_name, const ObUserDefinedType *&user_type); + int get_package_type(const ObPLResolveCtx &resolve_ctx, + uint64_t package_id, + const common::ObString &type_name, + const ObUserDefinedType *&user_type, + bool log_user_error = true); int get_package_type(const ObPLResolveCtx &resolve_ctx, uint64_t package_id, uint64_t type_id, const ObUserDefinedType *&user_type); diff --git a/src/pl/ob_pl_stmt.cpp b/src/pl/ob_pl_stmt.cpp index d4b6e145c1..1769f26cee 100644 --- a/src/pl/ob_pl_stmt.cpp +++ b/src/pl/ob_pl_stmt.cpp @@ -1374,10 +1374,10 @@ int ObPLExternalNS::search_in_standard_package(const common::ObString &name, if (OB_FAIL(package_manager.get_package_type(resolve_ctx_, standard_package_id, name, - user_type))) { + user_type, + false))) { if (OB_ERR_SP_UNDECLARED_TYPE == ret) { LOG_INFO("get standard package type not exist!", K(ret), K(standard_package_id), K(name)); - ob_reset_tsi_warning_buffer(); type = ObPLExternalNS::INVALID_VAR; ret = OB_SUCCESS; } else { @@ -1715,10 +1715,10 @@ int ObPLExternalNS::resolve_external_symbol(const common::ObString &name, if (OB_FAIL(package_manager.get_package_type(resolve_ctx_, parent_id, name, - user_type))) { + user_type, + false))) { LOG_WARN("failed to get package type", K(ret), K(parent_id), K(name)); if (OB_ERR_SP_UNDECLARED_TYPE == ret) { - ob_reset_tsi_warning_buffer(); type = ObPLExternalNS::INVALID_VAR; ret = OB_SUCCESS; }