diff --git a/src/Interpreters/Aggregator.cpp b/src/Interpreters/Aggregator.cpp index d0d073f9905..bb69504b9f7 100644 --- a/src/Interpreters/Aggregator.cpp +++ b/src/Interpreters/Aggregator.cpp @@ -679,8 +679,27 @@ void NO_INLINE Aggregator::executeImplBatch( size_t compiled_functions_count = 0; #if USE_EMBEDDED_COMPILER + +#if defined(MEMORY_SANITIZER) + size_t compiled_functions_places_size = 0; +#endif + if constexpr (use_compiled_functions) + { compiled_functions_count = compiled_aggregate_functions_holder->compiled_aggregate_functions.functions_count; + +#if defined(MEMORY_SANITIZER) + + if (compiled_functions_count < offsets_of_aggregate_states.size()) + { + compiled_functions_places_size = offsets_of_aggregate_states[compiled_functions_count]; + } + else + { + compiled_functions_places_size = total_size_of_aggregate_states; + } +#endif + } #endif std::unique_ptr places(new AggregateDataPtr[rows]); @@ -704,8 +723,15 @@ void NO_INLINE Aggregator::executeImplBatch( #if USE_EMBEDDED_COMPILER if constexpr (use_compiled_functions) + { compiled_aggregate_functions_holder->compiled_aggregate_functions.create_aggregate_states_function(aggregate_data); + +#if defined(MEMORY_SANITIZER) + __msan_unpoison(aggregate_data, compiled_functions_places_size); #endif + } +#endif + createAggregateStates(compiled_functions_count, aggregate_data); emplace_result.setMapped(aggregate_data); diff --git a/tests/queries/0_stateless/01890_jit_aggregation_function_sum.reference b/tests/queries/0_stateless/01890_jit_aggregation_function_sum_long.reference similarity index 100% rename from tests/queries/0_stateless/01890_jit_aggregation_function_sum.reference rename to tests/queries/0_stateless/01890_jit_aggregation_function_sum_long.reference diff --git a/tests/queries/0_stateless/01890_jit_aggregation_function_sum.sql b/tests/queries/0_stateless/01890_jit_aggregation_function_sum_long.sql similarity index 100% rename from tests/queries/0_stateless/01890_jit_aggregation_function_sum.sql rename to tests/queries/0_stateless/01890_jit_aggregation_function_sum_long.sql diff --git a/tests/queries/0_stateless/01891_jit_aggregation_function_any.reference b/tests/queries/0_stateless/01891_jit_aggregation_function_any_long.reference similarity index 100% rename from tests/queries/0_stateless/01891_jit_aggregation_function_any.reference rename to tests/queries/0_stateless/01891_jit_aggregation_function_any_long.reference diff --git a/tests/queries/0_stateless/01891_jit_aggregation_function_any.sql b/tests/queries/0_stateless/01891_jit_aggregation_function_any_long.sql similarity index 100% rename from tests/queries/0_stateless/01891_jit_aggregation_function_any.sql rename to tests/queries/0_stateless/01891_jit_aggregation_function_any_long.sql diff --git a/tests/queries/0_stateless/01892_jit_aggregation_function_any_last.reference b/tests/queries/0_stateless/01892_jit_aggregation_function_any_last_long.reference similarity index 100% rename from tests/queries/0_stateless/01892_jit_aggregation_function_any_last.reference rename to tests/queries/0_stateless/01892_jit_aggregation_function_any_last_long.reference diff --git a/tests/queries/0_stateless/01892_jit_aggregation_function_any_last.sql b/tests/queries/0_stateless/01892_jit_aggregation_function_any_last_long.sql similarity index 100% rename from tests/queries/0_stateless/01892_jit_aggregation_function_any_last.sql rename to tests/queries/0_stateless/01892_jit_aggregation_function_any_last_long.sql diff --git a/tests/queries/0_stateless/01893_jit_aggregation_function_min.reference b/tests/queries/0_stateless/01893_jit_aggregation_function_min_long.reference similarity index 100% rename from tests/queries/0_stateless/01893_jit_aggregation_function_min.reference rename to tests/queries/0_stateless/01893_jit_aggregation_function_min_long.reference diff --git a/tests/queries/0_stateless/01893_jit_aggregation_function_min.sql b/tests/queries/0_stateless/01893_jit_aggregation_function_min_long.sql similarity index 100% rename from tests/queries/0_stateless/01893_jit_aggregation_function_min.sql rename to tests/queries/0_stateless/01893_jit_aggregation_function_min_long.sql diff --git a/tests/queries/0_stateless/01894_jit_aggregation_function_max.reference b/tests/queries/0_stateless/01894_jit_aggregation_function_max_long.reference similarity index 100% rename from tests/queries/0_stateless/01894_jit_aggregation_function_max.reference rename to tests/queries/0_stateless/01894_jit_aggregation_function_max_long.reference diff --git a/tests/queries/0_stateless/01894_jit_aggregation_function_max.sql b/tests/queries/0_stateless/01894_jit_aggregation_function_max_long.sql similarity index 100% rename from tests/queries/0_stateless/01894_jit_aggregation_function_max.sql rename to tests/queries/0_stateless/01894_jit_aggregation_function_max_long.sql diff --git a/tests/queries/0_stateless/01895_jit_aggregation_function_avg.reference b/tests/queries/0_stateless/01895_jit_aggregation_function_avg_long.reference similarity index 100% rename from tests/queries/0_stateless/01895_jit_aggregation_function_avg.reference rename to tests/queries/0_stateless/01895_jit_aggregation_function_avg_long.reference diff --git a/tests/queries/0_stateless/01895_jit_aggregation_function_avg.sql b/tests/queries/0_stateless/01895_jit_aggregation_function_avg_long.sql similarity index 100% rename from tests/queries/0_stateless/01895_jit_aggregation_function_avg.sql rename to tests/queries/0_stateless/01895_jit_aggregation_function_avg_long.sql diff --git a/tests/queries/0_stateless/01896_jit_aggregation_function_if.reference b/tests/queries/0_stateless/01896_jit_aggregation_function_if_long.reference similarity index 100% rename from tests/queries/0_stateless/01896_jit_aggregation_function_if.reference rename to tests/queries/0_stateless/01896_jit_aggregation_function_if_long.reference diff --git a/tests/queries/0_stateless/01896_jit_aggregation_function_if.sql b/tests/queries/0_stateless/01896_jit_aggregation_function_if_long.sql similarity index 100% rename from tests/queries/0_stateless/01896_jit_aggregation_function_if.sql rename to tests/queries/0_stateless/01896_jit_aggregation_function_if_long.sql diff --git a/tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted.reference b/tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted_long.reference similarity index 100% rename from tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted.reference rename to tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted_long.reference diff --git a/tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted.sql b/tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted_long.sql similarity index 100% rename from tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted.sql rename to tests/queries/0_stateless/01897_jit_aggregation_function_avg_weighted_long.sql