mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Rename group_name to display_name
This commit is contained in:
parent
2216f9e0cc
commit
d3b6aafa09
@ -148,9 +148,9 @@ void Connection::receiveHello()
|
||||
{
|
||||
readStringBinary(server_timezone, *in);
|
||||
}
|
||||
if (server_revision >= DBMS_MIN_REVISION_WITH_SERVER_GROUP_NAME)
|
||||
if (server_revision >= DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME)
|
||||
{
|
||||
readStringBinary(server_group_name, *in);
|
||||
readStringBinary(server_display_name, *in);
|
||||
}
|
||||
}
|
||||
else if (packet_type == Protocol::Server::Exception)
|
||||
@ -207,12 +207,12 @@ const String & Connection::getServerTimezone()
|
||||
return server_timezone;
|
||||
}
|
||||
|
||||
const String & Connection::getServerGroupName()
|
||||
const String & Connection::getServerDisplayName()
|
||||
{
|
||||
if (!connected)
|
||||
connect();
|
||||
|
||||
return server_group_name;
|
||||
return server_display_name;
|
||||
}
|
||||
|
||||
void Connection::forceConnected()
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
void getServerVersion(String & name, UInt64 & version_major, UInt64 & version_minor, UInt64 & revision);
|
||||
|
||||
const String & getServerTimezone();
|
||||
const String & getServerGroupName();
|
||||
const String & getServerDisplayName();
|
||||
|
||||
/// For log and exception messages.
|
||||
const String & getDescription() const;
|
||||
@ -214,7 +214,7 @@ private:
|
||||
UInt64 server_version_minor = 0;
|
||||
UInt64 server_revision = 0;
|
||||
String server_timezone;
|
||||
String server_group_name;
|
||||
String server_display_name;
|
||||
|
||||
std::unique_ptr<Poco::Net::StreamSocket> socket;
|
||||
std::shared_ptr<ReadBuffer> in;
|
||||
|
@ -60,7 +60,7 @@
|
||||
#define DBMS_MIN_REVISION_WITH_QUOTA_KEY_IN_CLIENT_INFO 54060
|
||||
#define DBMS_MIN_REVISION_WITH_TABLES_STATUS 54226
|
||||
#define DBMS_MIN_REVISION_WITH_TIME_ZONE_PARAMETER_IN_DATETIME_DATA_TYPE 54337
|
||||
#define DBMS_MIN_REVISION_WITH_SERVER_GROUP_NAME 54355
|
||||
#define DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME 54355
|
||||
|
||||
/// Version of ClickHouse TCP protocol. Set to git tag with latest protocol change.
|
||||
#define DBMS_TCP_PROTOCOL_VERSION 54226
|
||||
|
@ -153,7 +153,7 @@ private:
|
||||
/// If the last query resulted in exception.
|
||||
bool got_exception = false;
|
||||
String server_version;
|
||||
String server_group_name;
|
||||
String server_display_name;
|
||||
|
||||
Stopwatch watch;
|
||||
|
||||
@ -426,7 +426,7 @@ private:
|
||||
connection->getServerVersion(server_name, server_version_major, server_version_minor, server_revision);
|
||||
|
||||
server_version = toString(server_version_major) + "." + toString(server_version_minor) + "." + toString(server_revision);
|
||||
server_group_name = connection->getServerGroupName();
|
||||
server_display_name = connection->getServerDisplayName();
|
||||
if (is_interactive)
|
||||
{
|
||||
std::cout << "Connected to " << server_name
|
||||
@ -452,7 +452,7 @@ private:
|
||||
{
|
||||
String query;
|
||||
String prev_query;
|
||||
String prompt = server_group_name.length() ? "[" + server_group_name + "] :) " : ":) ";
|
||||
String prompt = server_display_name.length() ? "[" + server_display_name + "] :) " : ":) ";
|
||||
while (char * line_ = readline(query.empty() ? prompt.c_str() : ":-] "))
|
||||
{
|
||||
String line = line_;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "TCPHandler.h"
|
||||
|
||||
#include <Common/NetException.h>
|
||||
#include <Common/getFQDNOrHostName.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -508,9 +509,9 @@ void TCPHandler::sendHello()
|
||||
{
|
||||
writeStringBinary(DateLUT::instance().getTimeZone(), *out);
|
||||
}
|
||||
if (client_revision >= DBMS_MIN_REVISION_WITH_SERVER_GROUP_NAME)
|
||||
if (client_revision >= DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME)
|
||||
{
|
||||
writeStringBinary(server.config().getString("group_name"), *out);
|
||||
writeStringBinary(server.config().getString("display_name", getFQDNOrHostName()), *out);
|
||||
}
|
||||
out->next();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<count>10</count>
|
||||
<!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
|
||||
</logger>
|
||||
<group_name>staging</group_name>
|
||||
<!--display_name>production</display_name--> <!-- It is the name that will be shown in the client -->
|
||||
<http_port>8123</http_port>
|
||||
<tcp_port>9000</tcp_port>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user