fix bug missing a error_code

This commit is contained in:
jingtaoye35
2023-04-17 05:11:33 +00:00
committed by ob-robot
parent 2ef15964cb
commit a84e9d9634
2 changed files with 18 additions and 12 deletions

View File

@ -321,16 +321,21 @@ int ObAlterUserProfileResolver::resolve_default_role(const ParseNode &parse_tree
}
OZ (params_.schema_checker_->get_user_info(tenant_id, user_name, host_name, user_info),
tenant_id, user_name, host_name);
if (ret == OB_USER_NOT_EXIST || OB_ISNULL(user_info)) {
ret = OB_USER_NOT_EXIST;
if (ret == OB_USER_NOT_EXIST) {
LOG_USER_ERROR(OB_USER_NOT_EXIST, user_name.length(), user_name.ptr());
} else if (OB_FAIL(check_dcl_on_inner_user(parse_tree.type_,
session_info_->get_priv_user_id(),
user_info->get_user_id()))) {
LOG_WARN("failed to check dcl on inner-user or unsupport to modify reserved user", K(ret),
K(session_info_->get_user_name()), K(user_name));
} else {
arg.user_id_ = user_info->get_user_id();
}
if (OB_SUCC(ret)) {
if (user_info == NULL) {
ret = OB_USER_NOT_EXIST;
LOG_USER_ERROR(OB_USER_NOT_EXIST, user_name.length(), user_name.ptr());
} else if (OB_FAIL(check_dcl_on_inner_user(parse_tree.type_,
session_info_->get_priv_user_id(),
user_info->get_user_id()))) {
LOG_WARN("failed to check dcl on inner-user or unsupport to modify reserved user", K(ret),
K(session_info_->get_user_name()), K(user_name));
} else {
arg.user_id_ = user_info->get_user_id();
}
}
/* 2. resolve default role */