From 6d1640643adfe5fddb9ee3a56f851bf76480237c Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Wed, 18 Mar 2020 19:40:23 +0300 Subject: [PATCH] Fix build. --- dbms/src/Columns/ColumnDecimal.cpp | 1 + dbms/src/Columns/ColumnVector.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dbms/src/Columns/ColumnDecimal.cpp b/dbms/src/Columns/ColumnDecimal.cpp index 373255963d0..2a0e9c8291e 100644 --- a/dbms/src/Columns/ColumnDecimal.cpp +++ b/dbms/src/Columns/ColumnDecimal.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include diff --git a/dbms/src/Columns/ColumnVector.cpp b/dbms/src/Columns/ColumnVector.cpp index a96a4605cc6..fa60d562814 100644 --- a/dbms/src/Columns/ColumnVector.cpp +++ b/dbms/src/Columns/ColumnVector.cpp @@ -68,7 +68,20 @@ void ColumnVector::updateWeakHash32(WeakHash32 & hash) const while (begin < end) { - *hash_data = intHashCRC32(*begin, *hash_data); + if constexpr (sizeof(T) <= sizeof(UInt64)) + { + *hash_data = intHashCRC32(*begin, *hash_data); + } + else + { + auto * begin64 = reinterpret_cast(begin); + for (size_t i = 0; i < sizeof(T); i += sizeof(UInt64)) + { + *hash_data = intHashCRC32(*begin64, *hash_data); + ++begin64; + } + } + ++begin; ++hash_data; }