fix external table bug
This commit is contained in:
@ -85,7 +85,8 @@ int ObExternalDataAccessDriver::get_file_size(const ObString &url, int64_t &file
|
|||||||
int temp_ret = device_handle_->stat(to_cstring(url), statbuf);
|
int temp_ret = device_handle_->stat(to_cstring(url), statbuf);
|
||||||
if (OB_SUCCESS != temp_ret) {
|
if (OB_SUCCESS != temp_ret) {
|
||||||
file_size = -1;
|
file_size = -1;
|
||||||
if (OB_BACKUP_FILE_NOT_EXIST == temp_ret) {
|
if (OB_BACKUP_FILE_NOT_EXIST == temp_ret
|
||||||
|
|| OB_IO_ERROR == temp_ret) {
|
||||||
file_size = -1;
|
file_size = -1;
|
||||||
} else {
|
} else {
|
||||||
ret = temp_ret;
|
ret = temp_ret;
|
||||||
@ -250,7 +251,17 @@ int ObExternalDataAccessDriver::get_file_list(const ObString &path,
|
|||||||
}
|
}
|
||||||
} else if (get_storage_type() == OB_STORAGE_FILE) {
|
} else if (get_storage_type() == OB_STORAGE_FILE) {
|
||||||
ObSEArray<ObString, 4> file_dirs;
|
ObSEArray<ObString, 4> file_dirs;
|
||||||
OZ (file_dirs.push_back(path));
|
bool is_dir = false;
|
||||||
|
ObString path_without_prifix;
|
||||||
|
path_without_prifix = path;
|
||||||
|
path_without_prifix += strlen(OB_FILE_PREFIX);
|
||||||
|
|
||||||
|
OZ (FileDirectoryUtils::is_directory(to_cstring(path_without_prifix), is_dir));
|
||||||
|
if (!is_dir) {
|
||||||
|
LOG_WARN("external location is not a directory", K(path_without_prifix));
|
||||||
|
} else {
|
||||||
|
OZ (file_dirs.push_back(path));
|
||||||
|
}
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < file_dirs.count(); i++) {
|
for (int64_t i = 0; OB_SUCC(ret) && i < file_dirs.count(); i++) {
|
||||||
ObString file_dir = file_dirs.at(i);
|
ObString file_dir = file_dirs.at(i);
|
||||||
ObLocalFileListArrayOpWithFilter dir_op(file_dirs, file_dir, path, NULL, allocator);
|
ObLocalFileListArrayOpWithFilter dir_op(file_dirs, file_dir, path, NULL, allocator);
|
||||||
|
|||||||
Reference in New Issue
Block a user