Commit c90c7698 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Simplified away CONNECT::host

Part of MDEV-19515 - Improve connect speed
parent 56b1cdde
...@@ -376,7 +376,6 @@ struct Pipe_Listener : public Listener ...@@ -376,7 +376,6 @@ struct Pipe_Listener : public Listener
statistic_increment(connection_errors_internal, &LOCK_status); statistic_increment(connection_errors_internal, &LOCK_status);
return; return;
} }
connect->host= my_localhost;
create_new_thread(connect); create_new_thread(connect);
} }
......
...@@ -6293,7 +6293,6 @@ void create_new_thread(CONNECT *connect) ...@@ -6293,7 +6293,6 @@ void create_new_thread(CONNECT *connect)
void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock) void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock)
{ {
CONNECT *connect; CONNECT *connect;
bool is_unix_sock;
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
{ {
...@@ -6342,8 +6341,8 @@ void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock) ...@@ -6342,8 +6341,8 @@ void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock)
if ((connect= new CONNECT())) if ((connect= new CONNECT()))
{ {
is_unix_sock= (mysql_socket_getfd(sock) == bool is_unix_sock= mysql_socket_getfd(sock) ==
mysql_socket_getfd(unix_sock)); mysql_socket_getfd(unix_sock);
if (!(connect->vio= if (!(connect->vio=
mysql_socket_vio_new(new_sock, mysql_socket_vio_new(new_sock,
...@@ -6365,9 +6364,6 @@ void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock) ...@@ -6365,9 +6364,6 @@ void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock)
return; return;
} }
if (is_unix_sock)
connect->host= my_localhost;
if (mysql_socket_getfd(sock) == mysql_socket_getfd(extra_ip_sock)) if (mysql_socket_getfd(sock) == mysql_socket_getfd(extra_ip_sock))
{ {
connect->extra_port= 1; connect->extra_port= 1;
......
...@@ -1517,7 +1517,10 @@ THD *CONNECT::create_thd(THD *thd) ...@@ -1517,7 +1517,10 @@ THD *CONNECT::create_thd(THD *thd)
init_net_server_extension(thd); init_net_server_extension(thd);
thd->security_ctx->host= host; thd->security_ctx->host= thd->net.vio->type == VIO_TYPE_NAMEDPIPE ||
thd->net.vio->type == VIO_TYPE_SOCKET ?
my_localhost : 0;
thd->extra_port= extra_port; thd->extra_port= extra_port;
thd->scheduler= scheduler; thd->scheduler= scheduler;
thd->real_id= real_id; thd->real_id= real_id;
......
...@@ -32,7 +32,6 @@ class CONNECT : public ilink { ...@@ -32,7 +32,6 @@ class CONNECT : public ilink {
public: public:
/* To be copied to THD */ /* To be copied to THD */
Vio *vio; /* Copied to THD with my_net_init() */ Vio *vio; /* Copied to THD with my_net_init() */
const char *host;
scheduler_functions *scheduler; scheduler_functions *scheduler;
my_thread_id thread_id; my_thread_id thread_id;
pthread_t real_id; pthread_t real_id;
...@@ -43,7 +42,7 @@ class CONNECT : public ilink { ...@@ -43,7 +42,7 @@ class CONNECT : public ilink {
ulonglong prior_thr_create_utime; ulonglong prior_thr_create_utime;
CONNECT() CONNECT()
:vio(0), host(0), scheduler(thread_scheduler), thread_id(0), real_id(0), :vio(0), scheduler(thread_scheduler), thread_id(0), real_id(0),
extra_port(0), extra_port(0),
thread_count_incremented(0), prior_thr_create_utime(0) thread_count_incremented(0), prior_thr_create_utime(0)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment