dbms: Server: added better diagnostic in union all type mismatch exceptions. [#METR-14099]

This commit is contained in:
Alexey Arno 2014-12-19 16:08:31 +03:00
parent 84456a08c3
commit d5c8b52f7c

View File

@ -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);
}
}