mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Works!
This commit is contained in:
parent
ebb4a6a0ed
commit
2467530583
@ -95,7 +95,8 @@ void Connection::disconnect()
|
||||
{
|
||||
//LOG_TRACE(log_wrapper.get(), "Disconnecting");
|
||||
|
||||
socket->close();
|
||||
if (socket)
|
||||
socket->close();
|
||||
socket = nullptr;
|
||||
in = nullptr;
|
||||
out = nullptr;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#define DBMS_DEFAULT_HOST "localhost"
|
||||
#define DBMS_DEFAULT_PORT 9000
|
||||
#define DBMS_DEFAULT_SECURE_PORT 9443
|
||||
#define DBMS_DEFAULT_PORT_STR #DBMS_DEFAULT_PORT
|
||||
#define DBMS_DEFAULT_HTTP_PORT 8123
|
||||
#define DBMS_DEFAULT_CONNECT_TIMEOUT_SEC 10
|
||||
|
@ -375,8 +375,12 @@ private:
|
||||
|
||||
void connect()
|
||||
{
|
||||
Protocol::Encryption::Enum encryption = config().getBool("secure", false)
|
||||
? Protocol::Encryption::Enable
|
||||
: Protocol::Encryption::Disable;
|
||||
|
||||
String host = config().getString("host", "localhost");
|
||||
UInt16 port = config().getInt("port", DBMS_DEFAULT_PORT);
|
||||
UInt16 port = config().getInt("port", config().getInt(encryption ? "tcps_port" : "tcp_port", encryption ? DBMS_DEFAULT_SECURE_PORT : DBMS_DEFAULT_PORT));
|
||||
String default_database = config().getString("database", "");
|
||||
String user = config().getString("user", "");
|
||||
String password = config().getString("password", "");
|
||||
@ -385,9 +389,6 @@ private:
|
||||
? Protocol::Compression::Enable
|
||||
: Protocol::Compression::Disable;
|
||||
|
||||
Protocol::Encryption::Enum encryption = config().getBool("secure", true)
|
||||
? Protocol::Encryption::Enable
|
||||
: Protocol::Encryption::Disable;
|
||||
if (is_interactive)
|
||||
std::cout << "Connecting to "
|
||||
<< (!default_database.empty() ? "database " + default_database + " at " : "")
|
||||
|
Loading…
Reference in New Issue
Block a user