mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
Omit EXPLAIN FORMAT for old TCP clients.
This commit is contained in:
parent
3f7cee1149
commit
4c37d461de
@ -383,6 +383,15 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
|
|||||||
ast = parseQuery(parser, begin, end, "", max_query_size, settings.max_parser_depth);
|
ast = parseQuery(parser, begin, end, "", max_query_size, settings.max_parser_depth);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (auto * ast_explain = typeid_cast<ASTExplainQuery *>(ast.get()))
|
||||||
|
{
|
||||||
|
const auto & client_info = context.getClientInfo();
|
||||||
|
/// Ignore format for old clients to ignore exception. Always return human-readable output.
|
||||||
|
if (client_info.interface == ClientInfo::Interface::TCP &&
|
||||||
|
(client_info.client_version_major < 21 || client_info.client_version_minor < 5))
|
||||||
|
ast_explain->format = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/// Interpret SETTINGS clauses as early as possible (before invoking the corresponding interpreter),
|
/// Interpret SETTINGS clauses as early as possible (before invoking the corresponding interpreter),
|
||||||
/// to allow settings to take effect.
|
/// to allow settings to take effect.
|
||||||
if (const auto * select_query = ast->as<ASTSelectQuery>())
|
if (const auto * select_query = ast->as<ASTSelectQuery>())
|
||||||
|
Loading…
Reference in New Issue
Block a user