mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix:ignore the format_version check when the data is empty
This commit is contained in:
parent
0114b69f61
commit
12211ffc5b
@ -149,12 +149,15 @@ MergeTreeData::MergeTreeData(
|
||||
min_format_version = MERGE_TREE_DATA_MIN_FORMAT_VERSION_WITH_CUSTOM_PARTITIONING;
|
||||
}
|
||||
|
||||
auto path_exists = Poco::File(full_path).exists();
|
||||
/// Creating directories, if not exist.
|
||||
Poco::File(full_path).createDirectories();
|
||||
|
||||
Poco::File(full_path + "detached").createDirectory();
|
||||
|
||||
String version_file_path = full_path + "format_version.txt";
|
||||
if (!attach)
|
||||
// When data path not exists, ignore the format_version check
|
||||
if (!attach || !path_exists)
|
||||
{
|
||||
format_version = min_format_version;
|
||||
WriteBufferFromFile buf(version_file_path);
|
||||
|
Loading…
Reference in New Issue
Block a user