**Describe the bug**
[A link to the report
](https://s3.amazonaws.com/clickhouse-test-reports/0/a298a5238b1a795ae0673af234a8f1c82637c1a3/fuzzer_astfuzzerasan//report.html)
**How to reproduce**
```sql

DROP TABLE IF EXISTS series__fuzz_35;

CREATE TABLE series__fuzz_35 (`i` UInt8, `x_value` Decimal(18, 14), `y_value` DateTime) ENGINE = Memory;

INSERT INTO series__fuzz_35(i, x_value, y_value) VALUES (1, 5.6,-4.4),(2, -9.6,3),(3, -1.3,-4),(4, 5.3,9.7),(5, 4.4,0.037),(6, -8.6,-7.8),(7, 5.1,9.3),(8, 7.9,-3.6),(9, -8.2,0.62),(10, -3,7.3);

SELECT skewSamp(x_value) FROM (SELECT x_value as x_value FROM series__fuzz_35 LIMIT 2);
```

```
=================================================================
==196220==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000737c740 at pc 0x0000232b6a0e bp 0x7f2be69c1d90 sp 0x7f2be69c1d88
READ of size 8 at 0x00000737c740 thread T257 (QueryPullPipeEx)
    #0 0x232b6a0d in common::exp10_i128(int) build_docker/../src/Common/intExp.h:137:12
    #1 0x232b6a0d in auto DB::DecimalUtils::scaleMultiplier<wide::integer<128ul, int>>(unsigned int) build_docker/../src/Core/DecimalFunctions.h:43:16
    #2 0x232b6a0d in void DB::DecimalUtils::convertToImpl<double, DB::Decimal<wide::integer<128ul, int>>, void>(DB::Decimal<wide::integer<128ul, int>> const&, unsigned long, double&) build_docker/../src/Core/DecimalFunctions.h:293:67
    #3 0x232b6a0d in double DB::DecimalUtils::convertTo<double, DB::Decimal<wide::integer<128ul, int>>>(DB::Decimal<wide::integer<128ul, int>> const&, unsigned long) build_docker/../src/Core/DecimalFunctions.h:340:5
    #4 0x232b6a0d in DB::VarMomentsDecimal<DB::Decimal<wide::integer<128ul, int>>, 3ul>::getMoment3(unsigned int) const build_docker/../src/AggregateFunctions/Moments.h:192:16
    #5 0x232b7636 in DB::AggregateFunctionVarianceSimple<DB::StatFuncOneArg<DB::Decimal<long>, (DB::StatisticsFunctionKind)5, 3ul>>::insertResultInto(char*, DB::IColumn&, DB::Arena*) const build_docker/../src/AggregateFunctions/AggregateFunctionStatisticsSimple.h:190:40
    #6 0x2e085eb0 in void DB::Aggregator::insertAggregatesIntoColumns<char*>(char*&, std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn>>>&, DB::Arena*) const build_docker/../src/Interpreters/Aggregator.cpp:1818:44
    #7 0x2deffa22 in DB::Aggregator::prepareBlockAndFillWithoutKey(DB::AggregatedDataVariants&, bool, bool) const build_docker/../src/Interpreters/Aggregator.cpp:2164:13
    #8 0x33022e76 in DB::ConvertingAggregatedToChunksTransform::initialize() build_docker/../src/Processors/Transforms/AggregatingTransform.cpp:333:45
    #9 0x32ad520d in DB::executeJob(DB::ExecutingGraph::Node*, DB::ReadProgressCallback*) build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:47:26
    #10 0x32ad520d in DB::ExecutionThreadContext::executeTask() build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:92:9
    #11 0x32ab45a4 in DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:228:26
    #12 0x32ab2e95 in DB::PipelineExecutor::executeSingleThread(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:194:5
    #13 0x32ab2e95 in DB::PipelineExecutor::executeImpl(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:367:9
    #14 0x32ab2a74 in DB::PipelineExecutor::execute(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:89:9
    #15 0x32adef9b in DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) build_docker/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:79:24
    #16 0x32adef9b in DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const build_docker/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:107:13
    #17 0x32adef9b in decltype(static_cast<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(fp)()) std::__1::__invoke_constexpr<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) build_docker/../contrib/libcxx/include/type_traits:3648:23
    #18 0x32adef9b in decltype(auto) std::__1::__apply_tuple_impl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/tuple:1595:1
    #19 0x32adef9b in decltype(auto) std::__1::apply<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&) build_docker/../contrib/libcxx/include/tuple:1604:1
    #20 0x32adef9b in ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()::operator()() build_docker/../src/Common/ThreadPool.h:193:13
    #21 0x32adef9b in decltype(static_cast<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(fp)()) std::__1::__invoke<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) build_docker/../contrib/libcxx/include/type_traits:3640:23
    #22 0x32adef9b in void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9
    #23 0x32adef9b in std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>::operator()() build_docker/../contrib/libcxx/include/__functional/function.h:230:12
    #24 0x32adef9b in void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>>(std::__1::__function::__policy_storage const*) build_docker/../contrib/libcxx/include/__functional/function.h:711:16
    #25 0x1ecf1a7f in std::__1::__function::__policy_func<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:843:16
    #26 0x1ecf1a7f in std::__1::function<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12
    #27 0x1ecf1a7f in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) build_docker/../src/Common/ThreadPool.cpp:294:17
    #28 0x1ecfb56c in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()::operator()() const build_docker/../src/Common/ThreadPool.cpp:144:73
    #29 0x1ecfb56c in decltype(static_cast<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&) build_docker/../contrib/libcxx/include/type_traits:3640:23
    #30 0x1ecfb56c in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/thread:282:5
    #31 0x1ecfb56c in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>>(void*) build_docker/../contrib/libcxx/include/thread:293:5
    #32 0x7f2e24b13608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477:8
    #33 0x7f2e24a38162 in __clone /build/glibc-sMfBJT/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
```
i10e18 * 100000000000000000ll * 100000000000000000ll * 10ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 1000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 10000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 1000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 10000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 1000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 10000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 1000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 10000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 1000000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 10000000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 10ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 100ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 1000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 10000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 100000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 1000000ll,
        i10e18 * 100000000000000000ll * 100000000000000000ll * 100000000000000000ll * 10000000ll,
    };
    return values[x];
}
}
template <typename T>
constexpr inline T intExp10OfSize(int x)