This commit is contained in:
kssenii 2023-12-11 13:24:31 +01:00
parent 23bde28ac4
commit c8c4db5984
3 changed files with 14 additions and 4 deletions

View File

@ -780,6 +780,13 @@ void IMergeTreeDataPart::loadProjections(bool require_columns_checksums, bool ch
addProjectionPart(projection.name, std::move(part)); addProjectionPart(projection.name, std::move(part));
} }
} }
else if (checksums.has(path))
{
auto part = getProjectionPartBuilder(projection.name).withPartFormatFromDisk().build();
part->setBrokenReason("Projection directory " + path + " does not exist while loading projections", ErrorCodes::NO_FILE_IN_DATA_PART);
addProjectionPart(projection.name, std::move(part));
has_broken_projection = true;
}
} }
} }

View File

@ -406,7 +406,7 @@ SELECT d FROM test WHERE c == 12 OR c == 16 ORDER BY d; proj_2
check table check table
1 1
0 0
broke all data of part 'proj' (parent part: all_2_2_0) broke all data of part 'proj' (parent part: all_1_1_0)
system.parts system.parts
all_0_0_0 1 ['proj','proj_2'] all_0_0_0 1 ['proj','proj_2']
all_1_1_0 1 ['proj','proj_2'] all_1_1_0 1 ['proj','proj_2']
@ -421,13 +421,13 @@ SELECT d FROM test WHERE c == 12 OR c == 16 ORDER BY d; proj_2
check table check table
0 0
broken projections info broken projections info
all_2_2_0 proj FILE_DOESNT_EXIST all_1_1_0 proj FILE_DOESNT_EXIST
BACKUP_CREATED BACKUP_CREATED
RESTORED RESTORED
system.parts system.parts
all_0_0_0 1 ['proj','proj_2'] all_0_0_0 1 ['proj','proj_2']
all_1_1_0 1 ['proj','proj_2'] all_1_1_0 1 ['proj','proj_2']
all_2_2_0 1 ['proj_2'] all_2_2_0 1 ['proj','proj_2']
all_3_3_0 1 ['proj','proj_2'] all_3_3_0 1 ['proj','proj_2']
select from projection 'proj' select from projection 'proj'
12 12
@ -442,3 +442,4 @@ SELECT d FROM test WHERE c == 12 OR c == 16 ORDER BY d; proj_2
check table check table
0 0
broken projections info broken projections info
all_1_1_0 proj NO_FILE_IN_DATA_PART

View File

@ -410,6 +410,8 @@ function test2()
check test2 check test2
} }
CLICKHOUSE_DATABASE="default"
CLICKHOUSE_TEST_UNIQUE_NAME="test123456"
function test3() function test3()
{ {
create_table test3 test 1 create_table test3 test 1
@ -473,7 +475,7 @@ function test3()
check test check test
break_projection test proj all_2_2_0 part break_projection test proj all_1_1_0 part
check test proj FILE_DOESNT_EXIST check test proj FILE_DOESNT_EXIST