fix 02802_clickhouse_disks_s3_copy.sh

This commit is contained in:
Julia Kartseva 2024-09-28 08:08:14 +00:00
parent a74a89b766
commit 6d8954a055
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include <Interpreters/Context.h>
#include "ICommand.h"
#include <IO/ReadBufferFromEmptyFile.h>
#include <IO/ReadBufferFromFile.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/copyData.h>
@ -39,7 +40,11 @@ public:
else
{
String relative_path_from = disk.getRelativeFromRoot(path_from.value());
return disk.getDisk()->readFile(relative_path_from);
auto res = disk.getDisk()->readFileIfExists(relative_path_from);
if (res)
return res;
/// For backward compatibility.
return std::make_unique<ReadBufferFromEmptyFile>();
}
}();

View File

@ -57,7 +57,7 @@ bool MetadataStorageFromPlainObjectStorage::existsFile(const std::string & path)
/// The path does not correspond to a directory.
auto directory = std::filesystem::path(object_key.serialize()) / "";
return !object_storage->exists(StoredObject(directory));
return !object_storage->existsOrHasAnyChild(directory);
}
bool MetadataStorageFromPlainObjectStorage::existsDirectory(const std::string & path) const