summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-02-27 19:38:39 +0200
committerunknown <bell@sanja.is.com.ua>2003-02-27 19:38:39 +0200
commite807bcf0e287c2ac729df010e56365800047e9f1 (patch)
tree46b83cf5ddbcf0a93b5eb75bc079ef5cc56aa5ba /sql/sql_show.cc
parente6dad7043682a140ed907b3dd5a79904603fde33 (diff)
parent1b9b2c3091fc580bff82ca0630221eabd5628d6c (diff)
downloadmariadb-git-e807bcf0e287c2ac729df010e56365800047e9f1.tar.gz
merging
sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index bf553113d53..a47d99143b6 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1017,6 +1017,7 @@ public:
template class I_List<thread_info>;
#endif
+#define LIST_PROCESS_HOST_LEN 64
void mysqld_list_processes(THD *thd,const char *user, bool verbose)
{
@@ -1030,7 +1031,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));
@@ -1059,7 +1060,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_or_ip);
+ 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;