Fix UBSan report in arraySum

This commit is contained in:
Alexey Milovidov 2021-01-21 14:42:34 +03:00
parent 110089086b
commit 2cd04e8923
3 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#include <Columns/ColumnDecimal.h>
#include "FunctionArrayMapped.h"
#include <Functions/FunctionFactory.h>
#include <common/defines.h>
namespace DB
@ -121,7 +122,7 @@ struct ArrayAggregateImpl
}
template <typename Element>
static bool executeType(const ColumnPtr & mapped, const ColumnArray::Offsets & offsets, ColumnPtr & res_ptr)
static NO_SANITIZE_UNDEFINED bool executeType(const ColumnPtr & mapped, const ColumnArray::Offsets & offsets, ColumnPtr & res_ptr)
{
using Result = ArrayAggregateResult<Element, aggregate_operation>;
using ColVecType = std::conditional_t<IsDecimalNumber<Element>, ColumnDecimal<Element>, ColumnVector<Element>>;

View File

@ -0,0 +1 @@
446744073709551616

View File

@ -0,0 +1 @@
SELECT arraySum([-9000000000000000000, -9000000000000000000]);