From 36188425795ed17299d34ed356434ec8914c0370 Mon Sep 17 00:00:00 2001 From: Alex Bocharov Date: Tue, 22 May 2018 12:23:07 +0100 Subject: [PATCH] Fix DateTime vs DateTime('UTC') inconsistency on data read. Original problem was described in PR #1650 and partially fixed by b5af4c95, however one place was forgotten and it was causing query exceptions when trying to read DateTime column across parts with different DateTime and DateTime('UTC') data type. --- dbms/src/Storages/ITableDeclaration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/ITableDeclaration.cpp b/dbms/src/Storages/ITableDeclaration.cpp index 9a6ac0e2538..92762046f7f 100644 --- a/dbms/src/Storages/ITableDeclaration.cpp +++ b/dbms/src/Storages/ITableDeclaration.cpp @@ -198,7 +198,7 @@ void ITableDeclaration::check(const NamesAndTypesList & provided_columns, const throw Exception("There is no column with name " + name + ". There are columns: " + listOfColumns(available_columns), ErrorCodes::NO_SUCH_COLUMN_IN_TABLE); - if (it->second->getName() != jt->second->getName()) + if (!it->second->equals(*jt->second)) throw Exception("Type mismatch for column " + name + ". Column has type " + jt->second->getName() + ", got type " + it->second->getName(), ErrorCodes::TYPE_MISMATCH);