From 851644d8bfad6b6ec748de5efe77debd22c7597d Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Thu, 25 Mar 2021 17:33:11 +0300 Subject: [PATCH] fix test --- programs/client/Client.cpp | 3 ++- src/Server/TCPHandler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index f7605e364f8..1aec3677b41 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1620,7 +1620,8 @@ private: const auto * insert = parsed_query->as(); if (insert && insert->settings_ast) apply_query_settings(*insert->settings_ast); - const auto * with_output = parsed_query->as(); + /// FIXME: try to prettify this cast using `as<>()` + const auto * with_output = dynamic_cast(parsed_query.get()); if (with_output && with_output->settings_ast) apply_query_settings(*with_output->settings_ast); diff --git a/src/Server/TCPHandler.cpp b/src/Server/TCPHandler.cpp index 059ba19f340..4915a435afe 100644 --- a/src/Server/TCPHandler.cpp +++ b/src/Server/TCPHandler.cpp @@ -1102,8 +1102,6 @@ void TCPHandler::receiveQuery() Settings passed_settings; passed_settings.read(*in, settings_format); - std::cout << "receive Query" << std::endl; - std::cout << passed_settings.output_format_json_named_tuples_as_objects << std::endl; /// Interserver secret. std::string received_hash; @@ -1120,6 +1118,8 @@ void TCPHandler::receiveQuery() readStringBinary(state.query, *in); + std::cout << state.query << std::endl; + /// It is OK to check only when query != INITIAL_QUERY, /// since only in that case the actions will be done. if (!cluster.empty() && client_info.query_kind != ClientInfo::QueryKind::INITIAL_QUERY)