broker/Manager: Fix deletion of composite keys

Follow-up for commit 44ae8f9e8f.

Closes #3342.
This commit is contained in:
Arne Welzel 2023-09-28 18:33:10 +02:00
parent bba07cea8b
commit 9badbc5232

View file

@ -1338,9 +1338,15 @@ void Manager::ProcessStoreEvent(broker::data msg)
auto key = erase.key(); auto key = erase.key();
DBG_LOG(DBG_BROKER, "Store %s: Erase key %s", erase.store_id().c_str(), DBG_LOG(DBG_BROKER, "Store %s: Erase key %s", erase.store_id().c_str(),
to_string(key).c_str()); to_string(key).c_str());
const auto& its = table->GetType()->AsTableType()->GetIndexTypes(); const auto& its = table->GetType()->AsTableType()->GetIndexTypes();
assert(its.size() == 1); ValPtr zeek_key;
auto zeek_key = detail::data_to_val(key, its[0].get()); if ( its.size() == 1 )
zeek_key = detail::data_to_val(key, its[0].get());
else
zeek_key = detail::data_to_val(key,
table->GetType()->AsTableType()->GetIndices().get());
if ( ! zeek_key ) if ( ! zeek_key )
{ {
reporter->Error("ProcessStoreEvent: could not convert key \"%s\" for store \"%s\" " reporter->Error("ProcessStoreEvent: could not convert key \"%s\" for store \"%s\" "