fix mysqltest

This commit is contained in:
wjhh2008 2023-08-15 03:40:36 +00:00 committed by ob-robot
parent 6283feb96f
commit 7a3e524f27
2 changed files with 6 additions and 8 deletions

View File

@ -4814,8 +4814,7 @@ int ObSQLUtils::check_location_access_priv(const ObString &location, ObSQLSessio
ObArenaAllocator allocator;
ObString real_location = location;
real_location += strlen(OB_FILE_PREFIX);
if (!real_location.empty() && '.' == real_location[0]) {
//Relative path
if (!real_location.empty()) {
ObArrayWrap<char> buffer;
OZ (buffer.allocate_array(allocator, PATH_MAX));
if (OB_SUCC(ret)) {
@ -5124,4 +5123,4 @@ int ObSQLUtils::print_identifier_require_quotes(ObCollationType collation_type,
require = true;
}
return ret;
}
}

View File

@ -98,16 +98,15 @@ int ObCreateDirectoryResolver::resolve(const ParseNode &parse_tree)
} else {
ObString real_directory_path;
directory_path.assign_ptr(child_node->str_value_, static_cast<int32_t>(child_node->str_len_));
directory_path.trim();
if (!directory_path.empty() && '.' == directory_path[0]) {
//Relative path
if (!directory_path.empty()) {
ObArrayWrap<char> buffer;
OZ (buffer.allocate_array(*allocator_, PATH_MAX));
if (OB_SUCC(ret)) {
real_directory_path = ObString(realpath(to_cstring(directory_path), buffer.get_data()));
if (real_directory_path.empty()) {
real_directory_path = directory_path;
}
}
} else {
real_directory_path = directory_path;
}
OZ (session_info_->get_secure_file_priv(secure_file_priv));
OZ (ObResolverUtils::check_secure_path(secure_file_priv, real_directory_path));