dbms: fixed error [#METR-11220].

This commit is contained in:
Alexey Milovidov 2014-05-23 04:35:14 +04:00
parent 0f5e847172
commit c815fe7a6f
2 changed files with 7 additions and 6 deletions

View File

@ -59,7 +59,7 @@ public:
virtual void create(AggregateDataPtr place) const = 0;
/// Уничтожить данные для агрегации.
virtual void destroy(AggregateDataPtr place) const = 0;
virtual void destroy(AggregateDataPtr place) const noexcept = 0;
/// Уничтожать данные не обязательно.
virtual bool hasTrivialDestructor() const = 0;
@ -118,7 +118,7 @@ public:
new (place) Data;
}
void destroy(AggregateDataPtr place) const
void destroy(AggregateDataPtr place) const noexcept
{
data(place).~Data();
}

View File

@ -265,14 +265,15 @@ void Aggregator::mergeDataImpl(
if (!inserted)
{
for (size_t i = 0; i < aggregates_size; ++i)
{
aggregate_functions[i]->merge(
Method::getAggregateData(res_it->second) + offsets_of_aggregate_states[i],
Method::getAggregateData(it->second) + offsets_of_aggregate_states[i]);
for (size_t i = 0; i < aggregates_size; ++i)
aggregate_functions[i]->destroy(
Method::getAggregateData(it->second) + offsets_of_aggregate_states[i]);
}
Method::getAggregateData(it->second) = nullptr;
}
else
{
@ -668,10 +669,10 @@ AggregatedDataVariantsPtr Aggregator::merge(ManyAggregatedDataVariants & data_va
AggregatedDataWithoutKey & current_data = current.without_key;
for (size_t i = 0; i < aggregates_size; ++i)
{
aggregate_functions[i]->merge(res_data + offsets_of_aggregate_states[i], current_data + offsets_of_aggregate_states[i]);
for (size_t i = 0; i < aggregates_size; ++i)
aggregate_functions[i]->destroy(current_data + offsets_of_aggregate_states[i]);
}
}
if (res->type == AggregatedDataVariants::KEY_64)