From 4af8e76bdd80041d84c5f5f573e33de6879d51e7 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Tue, 1 Oct 2019 13:01:55 +0300 Subject: [PATCH] Use proper types for Field. When a Field is inserted into a column, its type should be the same as the column data type to avoid implicit reinterpret_cast. Change a couple of usages where these types were different. --- dbms/src/Interpreters/QueryLog.h | 2 +- dbms/src/Storages/System/StorageSystemParts.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Interpreters/QueryLog.h b/dbms/src/Interpreters/QueryLog.h index 2b8f8120050..0bee61df394 100644 --- a/dbms/src/Interpreters/QueryLog.h +++ b/dbms/src/Interpreters/QueryLog.h @@ -22,7 +22,7 @@ namespace DB /// A struct which will be inserted as row into query_log table struct QueryLogElement { - enum Type + enum Type : UInt8 // Make it signed for compatibility with DataTypeEnum8 { QUERY_START = 1, QUERY_FINISH = 2, diff --git a/dbms/src/Storages/System/StorageSystemParts.cpp b/dbms/src/Storages/System/StorageSystemParts.cpp index 54626198373..42476419332 100644 --- a/dbms/src/Storages/System/StorageSystemParts.cpp +++ b/dbms/src/Storages/System/StorageSystemParts.cpp @@ -95,8 +95,8 @@ void StorageSystemParts::processNextStorage(MutableColumns & columns_, const Sto columns_[i++]->insert(part->getMinDate()); columns_[i++]->insert(part->getMaxDate()); - columns_[i++]->insert(part->getMinTime()); - columns_[i++]->insert(part->getMaxTime()); + columns_[i++]->insert(static_cast(part->getMinTime())); + columns_[i++]->insert(static_cast(part->getMaxTime())); columns_[i++]->insert(part->info.partition_id); columns_[i++]->insert(part->info.min_block); columns_[i++]->insert(part->info.max_block);