mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
dbms: fixed error with possible conflict of names of parts when doing ATTACH after DROP PARTITION [#METR-18510].
This commit is contained in:
parent
d5163b5060
commit
1b93d7d874
@ -2856,7 +2856,8 @@ void StorageReplicatedMergeTree::attachPartition(ASTPtr query, const Field & fie
|
|||||||
DayNum_t month = DateLUT::instance().makeDayNum(parse<UInt16>(partition.substr(0, 4)), parse<UInt8>(partition.substr(4, 2)), 1);
|
DayNum_t month = DateLUT::instance().makeDayNum(parse<UInt16>(partition.substr(0, 4)), parse<UInt8>(partition.substr(4, 2)), 1);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto existing_parts = data.getDataParts();
|
/// Немного неоптимально.
|
||||||
|
auto existing_parts = data.getAllDataParts();
|
||||||
for (const auto & part : existing_parts)
|
for (const auto & part : existing_parts)
|
||||||
if (part->month == month)
|
if (part->month == month)
|
||||||
min_used_number = std::min(min_used_number, part->left);
|
min_used_number = std::min(min_used_number, part->left);
|
||||||
|
Loading…
Reference in New Issue
Block a user