From 92fda25029552b522dc1b0d40a9b70a842d8210d Mon Sep 17 00:00:00 2001 From: chertus Date: Tue, 12 Nov 2019 03:18:13 +0300 Subject: [PATCH] fix UB (attempt 2) --- dbms/src/Functions/array/arrayCumSum.cpp | 3 ++- dbms/src/Functions/array/arraySum.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dbms/src/Functions/array/arrayCumSum.cpp b/dbms/src/Functions/array/arrayCumSum.cpp index 681a3fc27f1..8a23a6609b4 100644 --- a/dbms/src/Functions/array/arrayCumSum.cpp +++ b/dbms/src/Functions/array/arrayCumSum.cpp @@ -65,7 +65,8 @@ struct ArrayCumSumImpl typename ColVecResult::MutablePtr res_nested; if constexpr (IsDecimalNumber) { - const typename ColVecType::Container & data = column->getData(); + const typename ColVecType::Container & data = + checkAndGetColumn(&column_const->getDataColumn())->getData(); res_nested = ColVecResult::create(0, data.getScale()); } else diff --git a/dbms/src/Functions/array/arraySum.cpp b/dbms/src/Functions/array/arraySum.cpp index 5eb333f93e3..295dec36299 100644 --- a/dbms/src/Functions/array/arraySum.cpp +++ b/dbms/src/Functions/array/arraySum.cpp @@ -62,7 +62,8 @@ struct ArraySumImpl typename ColVecResult::MutablePtr res_column; if constexpr (IsDecimalNumber) { - const typename ColVecType::Container & data = column->getData(); + const typename ColVecType::Container & data = + checkAndGetColumn(&column_const->getDataColumn())->getData(); res_column = ColVecResult::create(offsets.size(), data.getScale()); } else