This commit is contained in:
Nikita Mikhaylov 2021-03-25 16:49:07 +03:00
parent a5d55781b1
commit cef9e19eb2
6 changed files with 8 additions and 13 deletions

View File

@ -561,7 +561,6 @@ private:
connect();
/// Initialize DateLUT here to avoid counting time spent here as query execution time.
const auto local_tz = DateLUT::instance().getTimeZone();
if (!context->getSettingsRef().use_client_time_zone)

View File

@ -1,5 +1,4 @@
#include <Poco/Net/NetException.h>
#include <Poco/Net/SocketAddress.h>
#include <Core/Defines.h>
#include <Core/Settings.h>
#include <Compression/CompressedReadBuffer.h>
@ -21,7 +20,6 @@
#include <Common/StringUtils/StringUtils.h>
#include <Common/OpenSSLHelpers.h>
#include <Common/randomSeed.h>
#include <Core/Protocol.h>
#include <Interpreters/ClientInfo.h>
#include <Compression/CompressionFactory.h>
#include <Processors/Pipe.h>
@ -91,10 +89,7 @@ void Connection::connect(const ConnectionTimeouts & timeouts)
socket = std::make_unique<Poco::Net::StreamSocket>();
}
if (!explicitly_resolved_address)
current_resolved_address = DNSResolver::instance().resolveAddress(host, port);
else
current_resolved_address = Poco::Net::SocketAddress(explicitly_resolved_address.value());
current_resolved_address = DNSResolver::instance().resolveAddress(host, port);
const auto & connection_timeout = static_cast<bool>(secure) ? timeouts.secure_connection_timeout : timeouts.connection_timeout;
socket->connect(*current_resolved_address, connection_timeout);
@ -417,7 +412,7 @@ void Connection::sendQuery(
{
if (!connected)
connect(timeouts);
TimeoutSetter timeout_setter(*socket, timeouts.send_timeout, timeouts.receive_timeout, true);
if (settings)
@ -452,6 +447,7 @@ void Connection::sendQuery(
/// Per query settings.
if (settings)
{
std::cout << "Settings enabled" << std::endl;
auto settings_format = (server_revision >= DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS) ? SettingsWriteFormat::STRINGS_WITH_FLAGS
: SettingsWriteFormat::BINARY;
settings->write(*out, settings_format);

View File

@ -208,9 +208,6 @@ public:
private:
String host;
UInt16 port;
std::optional<String> explicitly_resolved_address;
String default_database;
String user;
String password;

View File

@ -477,7 +477,7 @@ DataTypePtr FunctionOverloadResolverAdaptor::getReturnTypeDefaultImplementationF
}
if (null_presence.has_nullable)
{
Block nested_columns{createBlockWithNestedColumns(arguments)};
auto nested_columns = Block(createBlockWithNestedColumns(arguments));
auto return_type = getter(ColumnsWithTypeAndName(nested_columns.begin(), nested_columns.end()));
return makeNullable(return_type);
}

View File

@ -1102,6 +1102,9 @@ 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;
if (client_tcp_protocol_version >= DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET)

View File

@ -105,7 +105,7 @@ private:
friend class StorageS3Distributed;
friend class TableFunctionS3Distributed;
friend class StorageS3SequentialSource;
friend class StorageS3Distributed;
struct ClientAuthentificaiton
{
const S3::URI uri;