diff --git a/dbms/src/Core/DateTime64.cpp b/dbms/src/Core/DateTime64.cpp deleted file mode 100644 index 5676f005cea..00000000000 --- a/dbms/src/Core/DateTime64.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -#include - -namespace DB { - -//static constexpr UInt32 NANOS_PER_SECOND = 1000 * 1000 * 1000; - -//DateTime64::Components DateTime64::split() const -//{ -// auto datetime = static_cast(t / NANOS_PER_SECOND); -// auto nanos = static_cast(t % NANOS_PER_SECOND); -// return Components { datetime, nanos }; -//} - -//DateTime64::DateTime64(DateTime64::Components c) -// : t {c.datetime * NANOS_PER_SECOND + c.nanos} -//{ -// assert(c.nanos < NANOS_PER_SECOND); -//} - -} diff --git a/dbms/src/Core/DateTime64.h b/dbms/src/Core/DateTime64.h deleted file mode 100644 index e87ad217b77..00000000000 --- a/dbms/src/Core/DateTime64.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include - -namespace DB { - -//// this is a separate struct to avoid accidental conversions that -//// might occur between time_t and the type storing the datetime64 -//// time_t might have a different definition on different libcs -//struct DateTime64 { -// using Type = Int64; -// struct Components { -// time_t datetime = 0; -// UInt32 nanos = 0; -// }; - -// Components split() const; -// explicit DateTime64(Components c); -// explicit DateTime64(Type tt) : t{tt} {} -// explicit operator bool() const { -// return t != 0; -// } -// Type get() const { return t; } -//private: -// Type t; -//}; - -} diff --git a/dbms/src/DataTypes/DataTypeDateTime.h b/dbms/src/DataTypes/DataTypeDateTime.h index 8dc2ee6ca99..a978bf6962d 100644 --- a/dbms/src/DataTypes/DataTypeDateTime.h +++ b/dbms/src/DataTypes/DataTypeDateTime.h @@ -48,7 +48,8 @@ protected: * Server time zone is the time zone specified in 'timezone' parameter in configuration file, * or system time zone at the moment of server startup. */ -class DataTypeDateTime final : public DataTypeNumberBase, public TimezoneMixin { +class DataTypeDateTime final : public DataTypeNumberBase, public TimezoneMixin +{ public: explicit DataTypeDateTime(const std::string & time_zone_name = ""); @@ -79,7 +80,8 @@ public: * * `scale` determines number of decimal places for sub-second part of the DateTime64. */ -class DataTypeDateTime64 final : public DataTypeDecimalBase, public TimezoneMixin { +class DataTypeDateTime64 final : public DataTypeDecimalBase, public TimezoneMixin +{ public: static constexpr UInt8 default_scale = 3; diff --git a/dbms/src/Functions/FunctionDateOrDateTimeToSomething.h b/dbms/src/Functions/FunctionDateOrDateTimeToSomething.h index ba26e99473d..08c54a8396d 100644 --- a/dbms/src/Functions/FunctionDateOrDateTimeToSomething.h +++ b/dbms/src/Functions/FunctionDateOrDateTimeToSomething.h @@ -16,7 +16,8 @@ namespace ErrorCodes } template -struct WithDateTime64Converter : public Transform { +struct WithDateTime64Converter : public Transform +{ UInt8 scale; Transform transform; diff --git a/dbms/src/Functions/now.cpp b/dbms/src/Functions/now.cpp index e88878b7e93..cdc17e9c570 100644 --- a/dbms/src/Functions/now.cpp +++ b/dbms/src/Functions/now.cpp @@ -16,7 +16,8 @@ namespace ErrorCodes extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; } -DateTime64::NativeType nowSubsecond(UInt32 scale) { +DateTime64::NativeType nowSubsecond(UInt32 scale) +{ timespec spec; clock_gettime(CLOCK_REALTIME, &spec);