From d5c8b52f7c68b15f7439c9cf5f094a4ce624526f Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Fri, 19 Dec 2014 16:08:31 +0300 Subject: [PATCH] dbms: Server: added better diagnostic in union all type mismatch exceptions. [#METR-14099] --- dbms/src/Interpreters/InterpreterSelectQuery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 89f77a9e6ab..a1a9f04b5c8 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -99,7 +99,8 @@ void InterpreterSelectQuery::init(BlockInputStreamPtr input_, const NamesAndType interpreter = interpreter->next_select_in_union_all.get(); Block current = interpreter->getSampleBlock(); if (!blocksHaveEqualStructure(first, current)) - throw Exception("Result structures mismatch in the SELECT queries of the UNION ALL chain", + throw Exception("Result structures mismatch in the SELECT queries of the UNION ALL chain. Found result structure:\n\n" + current.dumpStructure() + + "\n\nwhile expecting:\n\n" + first.dumpStructure() + "\n\ninstead", ErrorCodes::UNION_ALL_RESULT_STRUCTURES_MISMATCH); } }