From 2cb3d379131789688ec381ebaea1e96e428a7a14 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Tue, 10 Mar 2020 16:17:34 +0800 Subject: [PATCH] Minor: Comment reworded and style fixes --- dbms/src/Functions/FunctionBinaryArithmetic.h | 7 ++++--- dbms/src/Functions/formatDateTime.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dbms/src/Functions/FunctionBinaryArithmetic.h b/dbms/src/Functions/FunctionBinaryArithmetic.h index 63961cc0bb7..8314e6fca8b 100644 --- a/dbms/src/Functions/FunctionBinaryArithmetic.h +++ b/dbms/src/Functions/FunctionBinaryArithmetic.h @@ -823,11 +823,12 @@ public: type_res = std::make_shared(left.getPrecision(), left.getScale()); else if constexpr (IsDataTypeDecimal) type_res = std::make_shared(right.getPrecision(), right.getScale()); - // Special case for DateTime: binary OPS should not looze the timezone of the result type, - // but reuse timezone of DateTime argument. - // NOTE: binary plus/minus are not allowed on DateTime64, and we are not handling it here. else if constexpr (std::is_same_v) { + // Special case for DateTime: binary OPS should reuse timezone + // of DateTime argument as timezeone of result type. + // NOTE: binary plus/minus are not allowed on DateTime64, and we are not handling it here. + const TimezoneMixin * tz = nullptr; if constexpr (std::is_same_v) tz = &right; diff --git a/dbms/src/Functions/formatDateTime.cpp b/dbms/src/Functions/formatDateTime.cpp index ce6a30aac89..c7f3f62a4e3 100644 --- a/dbms/src/Functions/formatDateTime.cpp +++ b/dbms/src/Functions/formatDateTime.cpp @@ -315,7 +315,7 @@ public: const DateLUTImpl * time_zone_tmp = nullptr; if (std::is_same_v || std::is_same_v) - time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 3, 0); + time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 3, 0); else time_zone_tmp = &DateLUT::instance();