diff --git a/src/Common/FileChecker.cpp b/src/Common/FileChecker.cpp index b306c3af990..1092b50b741 100644 --- a/src/Common/FileChecker.cpp +++ b/src/Common/FileChecker.cpp @@ -82,6 +82,8 @@ CheckResults FileChecker::check() const void FileChecker::repair() { + initialize(); + for (const auto & name_size : map) { const String & name = name_size.first; diff --git a/src/Storages/StorageTinyLog.cpp b/src/Storages/StorageTinyLog.cpp index 5cdec491393..a7ac592ac04 100644 --- a/src/Storages/StorageTinyLog.cpp +++ b/src/Storages/StorageTinyLog.cpp @@ -95,7 +95,7 @@ private: struct Stream { Stream(const DiskPtr & disk, const String & data_path, size_t max_read_buffer_size_, size_t file_size) - : plain(disk->readFile(data_path, std::min(max_read_buffer_size_, file_size))), + : plain(file_size ? disk->readFile(data_path, std::min(max_read_buffer_size_, file_size)) : std::make_unique(nullptr, 0)), limited(std::make_unique(*plain, file_size, false)), compressed(*limited) { @@ -132,10 +132,6 @@ Chunk TinyLogSource::generate() return {}; } - /// if there are no files in the folder, it means that the table is empty - if (storage.disk->isDirectoryEmpty(storage.table_path)) - return {}; - for (const auto & name_type : columns) { MutableColumnPtr column = name_type.type->createColumn();