mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 11:02:08 +00:00
Merge pull request #49874 from azat/build/fix
Fix "reference to local binding" after fixes for clang-17
This commit is contained in:
commit
c9d6ee3c98
@ -339,37 +339,37 @@ void KeeperStorage::UncommittedState::applyDelta(const Delta & delta)
|
|||||||
nodes.emplace(delta.path, UncommittedNode{.node = nullptr});
|
nodes.emplace(delta.path, UncommittedNode{.node = nullptr});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto & [node, acls, last_applied_zxid] = nodes.at(delta.path);
|
|
||||||
|
|
||||||
std::visit(
|
std::visit(
|
||||||
[&, &my_node = node, &my_acls = acls, &my_last_applied_zxid = last_applied_zxid]<typename DeltaType>(const DeltaType & operation)
|
[&]<typename DeltaType>(const DeltaType & operation)
|
||||||
{
|
{
|
||||||
|
auto & [node, acls, last_applied_zxid] = nodes.at(delta.path);
|
||||||
|
|
||||||
if constexpr (std::same_as<DeltaType, CreateNodeDelta>)
|
if constexpr (std::same_as<DeltaType, CreateNodeDelta>)
|
||||||
{
|
{
|
||||||
assert(!my_node);
|
assert(!node);
|
||||||
my_node = std::make_shared<Node>();
|
node = std::make_shared<Node>();
|
||||||
my_node->stat = operation.stat;
|
node->stat = operation.stat;
|
||||||
my_node->setData(operation.data);
|
node->setData(operation.data);
|
||||||
my_acls = operation.acls;
|
acls = operation.acls;
|
||||||
my_last_applied_zxid = delta.zxid;
|
last_applied_zxid = delta.zxid;
|
||||||
}
|
}
|
||||||
else if constexpr (std::same_as<DeltaType, RemoveNodeDelta>)
|
else if constexpr (std::same_as<DeltaType, RemoveNodeDelta>)
|
||||||
{
|
{
|
||||||
assert(my_node);
|
assert(node);
|
||||||
my_node = nullptr;
|
node = nullptr;
|
||||||
my_last_applied_zxid = delta.zxid;
|
last_applied_zxid = delta.zxid;
|
||||||
}
|
}
|
||||||
else if constexpr (std::same_as<DeltaType, UpdateNodeDelta>)
|
else if constexpr (std::same_as<DeltaType, UpdateNodeDelta>)
|
||||||
{
|
{
|
||||||
assert(my_node);
|
assert(node);
|
||||||
my_node->invalidateDigestCache();
|
node->invalidateDigestCache();
|
||||||
operation.update_fn(*node);
|
operation.update_fn(*node);
|
||||||
my_last_applied_zxid = delta.zxid;
|
last_applied_zxid = delta.zxid;
|
||||||
}
|
}
|
||||||
else if constexpr (std::same_as<DeltaType, SetACLDelta>)
|
else if constexpr (std::same_as<DeltaType, SetACLDelta>)
|
||||||
{
|
{
|
||||||
my_acls = operation.acls;
|
acls = operation.acls;
|
||||||
my_last_applied_zxid = delta.zxid;
|
last_applied_zxid = delta.zxid;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
delta.operation);
|
delta.operation);
|
||||||
|
Loading…
Reference in New Issue
Block a user