mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
fix UB
This commit is contained in:
parent
a8a283ffdc
commit
4411edeadd
@ -51,7 +51,6 @@ struct ArrayCumSumImpl
|
||||
using ColVecResult = std::conditional_t<IsDecimalNumber<Result>, ColumnDecimal<Result>, ColumnVector<Result>>;
|
||||
|
||||
const ColVecType * column = checkAndGetColumn<ColVecType>(&*mapped);
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
|
||||
if (!column)
|
||||
{
|
||||
@ -65,7 +64,10 @@ struct ArrayCumSumImpl
|
||||
|
||||
typename ColVecResult::MutablePtr res_nested;
|
||||
if constexpr (IsDecimalNumber<Element>)
|
||||
{
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
res_nested = ColVecResult::create(0, data.getScale());
|
||||
}
|
||||
else
|
||||
res_nested = ColVecResult::create();
|
||||
|
||||
@ -90,6 +92,7 @@ struct ArrayCumSumImpl
|
||||
return true;
|
||||
}
|
||||
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
const IColumn::Offsets & offsets = array.getOffsets();
|
||||
|
||||
typename ColVecResult::MutablePtr res_nested;
|
||||
|
@ -49,7 +49,6 @@ struct ArraySumImpl
|
||||
using ColVecResult = std::conditional_t<IsDecimalNumber<Result>, ColumnDecimal<Result>, ColumnVector<Result>>;
|
||||
|
||||
const ColVecType * column = checkAndGetColumn<ColVecType>(&*mapped);
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
|
||||
if (!column)
|
||||
{
|
||||
@ -62,7 +61,10 @@ struct ArraySumImpl
|
||||
|
||||
typename ColVecResult::MutablePtr res_column;
|
||||
if constexpr (IsDecimalNumber<Element>)
|
||||
{
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
res_column = ColVecResult::create(offsets.size(), data.getScale());
|
||||
}
|
||||
else
|
||||
res_column = ColVecResult::create(offsets.size());
|
||||
|
||||
@ -79,6 +81,8 @@ struct ArraySumImpl
|
||||
return true;
|
||||
}
|
||||
|
||||
const typename ColVecType::Container & data = column->getData();
|
||||
|
||||
typename ColVecResult::MutablePtr res_column;
|
||||
if constexpr (IsDecimalNumber<Element>)
|
||||
res_column = ColVecResult::create(offsets.size(), data.getScale());
|
||||
|
Loading…
Reference in New Issue
Block a user