From 1b9b2c3091fc580bff82ca0630221eabd5628d6c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Feb 2003 22:07:26 +0200 Subject: client port number added to SHOW PROCESSLIST (SCRUM?) include/violite.h: port added to reported parameters libmysqld/lib_vio.c: port added to reported parameters sql/sql_class.h: port added to reported parameters sql/sql_parse.cc: port added to reported parameters sql/sql_show.cc: SHOW PROCESSLIST will report port number if it is possible vio/viosocket.c: port added to reported parameters --- sql/sql_show.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4faee7d248f..9c3de1c4338 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1016,6 +1016,7 @@ public: template class I_List; #endif +#define LIST_PROCESS_HOST_LEN 64 void mysqld_list_processes(THD *thd,const char *user, bool verbose) { @@ -1029,7 +1030,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) field_list.push_back(new Item_int("Id",0,7)); field_list.push_back(new Item_empty_string("User",16)); - field_list.push_back(new Item_empty_string("Host",64)); + field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN)); field_list.push_back(field=new Item_empty_string("db",NAME_LEN)); field->maybe_null=1; field_list.push_back(new Item_empty_string("Command",16)); @@ -1058,10 +1059,17 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->user=thd->strdup(tmp->user ? tmp->user : (tmp->system_thread ? "system user" : "unauthenticated user")); - thd_info->host=thd->strdup(tmp->host ? tmp->host : - (tmp->ip ? tmp->ip : - (tmp->system_thread ? "none" : - "connecting host"))); + if (tmp->peer_port && (tmp->host || tmp->ip)) + { + if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1))) + snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, "%s:%u", + (tmp->host ? tmp->host : tmp->ip), tmp->peer_port); + } + else + thd_info->host= thd->strdup(tmp->host ? tmp->host : + (tmp->ip ? tmp->ip : + (tmp->system_thread ? "none" : + "connecting host"))); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; -- cgit v1.2.1 From b01f20db91e163cfebb2e5ecf743241074ab7355 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Feb 2003 20:31:54 +0200 Subject: posreview changing (SCRUM) increased compatibility postmerge changing sql/sql_class.h: increased compatibility sql/sql_show.cc: postmerge changing vio/viosocket.c: increased compatibility --- sql/sql_show.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a47d99143b6..62977ab5fb2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1064,13 +1064,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) { if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1))) snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, "%s:%u", - (tmp->host ? tmp->host : tmp->ip), tmp->peer_port); + thd->host_or_ip, tmp->peer_port); } else - thd_info->host= thd->strdup(tmp->host ? tmp->host : - (tmp->ip ? tmp->ip : - (tmp->system_thread ? "none" : - "connecting host"))); + thd_info->host= thd->strdup(thd->host_or_ip); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; -- cgit v1.2.1 From c56f268ffecde0f5867b1fc66fd72ab56d800d3b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Feb 2003 21:17:44 +0200 Subject: used correct function (SCRUM) sql/sql_show.cc: used correct function --- sql/sql_show.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 62977ab5fb2..95197ecfc4b 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1063,8 +1063,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) if (tmp->peer_port && (tmp->host || tmp->ip)) { if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1))) - snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, "%s:%u", - thd->host_or_ip, tmp->peer_port); + my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, + "%s:%u", thd->host_or_ip, tmp->peer_port); } else thd_info->host= thd->strdup(thd->host_or_ip); -- cgit v1.2.1