From af84814e51506fc0dd74ce4f966ec66b0932f531 Mon Sep 17 00:00:00 2001 From: chertus Date: Wed, 5 Feb 2020 17:25:33 +0300 Subject: [PATCH 1/2] fix for T64 data incompatibility --- dbms/src/Core/Types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Core/Types.h b/dbms/src/Core/Types.h index 4f350ba00d5..7c34d796e39 100644 --- a/dbms/src/Core/Types.h +++ b/dbms/src/Core/Types.h @@ -14,6 +14,8 @@ namespace DB struct Null {}; +/// @warning Append only enum! Ids in this enum could be serialized in data. +/// You MUST NOT change the order, insert or remove ids in the middle. enum class TypeIndex { Nothing = 0, @@ -31,7 +33,6 @@ enum class TypeIndex Float64, Date, DateTime, - DateTime64, String, FixedString, Enum8, @@ -48,6 +49,7 @@ enum class TypeIndex Function, AggregateFunction, LowCardinality, + DateTime64, }; using UInt8 = uint8_t; From 3368af109e9748ee16c1bb1c01a9ccdc28935a10 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 5 Feb 2020 18:08:54 +0300 Subject: [PATCH 2/2] Explicit values are more conspicuous. --- dbms/src/Core/Types.h | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/dbms/src/Core/Types.h b/dbms/src/Core/Types.h index 7c34d796e39..f844befe1f6 100644 --- a/dbms/src/Core/Types.h +++ b/dbms/src/Core/Types.h @@ -18,38 +18,38 @@ struct Null {}; /// You MUST NOT change the order, insert or remove ids in the middle. enum class TypeIndex { - Nothing = 0, - UInt8, - UInt16, - UInt32, - UInt64, - UInt128, - Int8, - Int16, - Int32, - Int64, - Int128, - Float32, - Float64, - Date, - DateTime, - String, - FixedString, - Enum8, - Enum16, - Decimal32, - Decimal64, - Decimal128, - UUID, - Array, - Tuple, - Set, - Interval, - Nullable, - Function, - AggregateFunction, - LowCardinality, - DateTime64, + Nothing = 0, + UInt8 = 1, + UInt16 = 2, + UInt32 = 3, + UInt64 = 4, + UInt128 = 5, + Int8 = 6, + Int16 = 7, + Int32 = 8, + Int64 = 9, + Int128 = 10, + Float32 = 11, + Float64 = 12, + Date = 13, + DateTime = 14, + String = 15, + FixedString = 16, + Enum8 = 17, + Enum16 = 18, + Decimal32 = 19, + Decimal64 = 20, + Decimal128 = 21, + UUID = 22, + Array = 23, + Tuple = 24, + Set = 25, + Interval = 26, + Nullable = 27, + Function = 28, + AggregateFunction = 29, + LowCardinality = 30, + DateTime64 = 31, }; using UInt8 = uint8_t;